jquery文件上传 - 如何覆盖文件不重命名 [英] jquery file upload - how to overwrite file NOT rename
问题描述
我已经应用了此链接所涵盖的更改: https:// github。 com / blueimp / jQuery-File-Upload / issues / 1965
但是我似乎无法覆盖这个插件来实现这个功能?
这里还有一个尚未解答的问题:通过bluimp上传jQuery文件上传,如何替换而不是重命名
有关这方面的任何指导将非常感激。
如果使用wiki中存在的UploadHandler.php,那很简单。在get_file_name方法中,您应该替换这一行:
return $ this - > get_unique_filename($ this - > trim_file_name($ name,$ type,$ index,$ content_range),$ type,$ index,$ content_range);
用这个:
返回$ this - > trim_file_name($ name,$ type,$ index,$ content_range);
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);
这篇关于jquery文件上传 - 如何覆盖文件不重命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!