I\'m using the Blueimp jQuery file upload tool. I\'d like to completely rename the files as they\'re uploaded. Since photos are being added to a unique directory based on the us
For those who only what to give the name
through the $options
:
Replace (line 1056?)
$file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error, $index, $content_range);
with
$extension = pathinfo($name , PATHINFO_EXTENSION);
if ( $extension != "" ){
$extension = "." . $extension;
}
$file->name = (isset($this->options['filename']) && isset($extension) )
? $this->options['filename'] . $extension
: $this->get_file_name($uploaded_file, $name, $size, $type, $error, $index, $content_range);
Then give the name in the option like this:
$upload_handler = new UploadHandler(array(['filename' => 'whatever' ]));