Is it possible to change the filename of the file being uploaded via jquery blueimp?
require('UploadHandler.php');
class CustomUploadHandler extends UploadHandler {
protected function trim_file_name($file_path, $name, $size, $type, $error, $index, $content_range) {
$name = 'First_' . microtime(true);
$name = str_replace('.', '', $name);
return $name;
}
}
$upload_handler = new CustomUploadHandler();
In your custom file index.php initialize this function of UploadHandler.php
This can be achieved with only change the trim_file_name() function to the following in the UploadHandler.php file.
protected function trim_file_name(VARIABLES) {
$name = uniqid();
return $name;
}
and that's all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With