I am struggling to update the Jquery file upload plugin so when you upload a file it just overwrites an existing file with the same name instead of renaming it with an upcount.
I have applied the change covered in this link: https://github.com/blueimp/jQuery-File-Upload/issues/1965
but I can't seem overwrite this plugin to get this working?
there's an existing open question not yet answered here: jQuery File Upload by bluimp, how to replace instead of renaming
any guidance on this would be much appreciated.
If you using UploadHandler.php that is exists in the wiki it's simple. In the get_file_name method you should replace this line:
return $this -> get_unique_filename($this -> trim_file_name($name, $type, $index, $content_range), $type, $index, $content_range);
with this:
return $this -> trim_file_name($name, $type, $index, $content_range);