jQuery File Upload by bluimp, how to replace instead of renaming
First of all the jQuery plugin can be found here: https://github.com/blueimp/jQuery-File-Upload I'm using the PHP-version of the script and I'm trying to replace images that has the same name instead of renaming them. I think I've found the functions that do the renaming, but the edits I tried do not work. protected function upcount_name_callback($matches) { $index = isset($matches[1]) ? intval($matches[1]) + 1 : 1; $ext = isset($matches[2]) ? $matches[2] : ''; return ' ('.$index.')'.$ext; } protected function upcount_name($name) { return preg_replace_callback( '/(?:(?: \(([\d]+)\))?(\.[^.]+))