thecodingmachine/html.widgets.jqueryfileupload

Unable to upload a picture with the same name

Closed this issue · 1 comments

If a picture is uploaded and has the same name in the directory, the widget thoughs an error. It would be nice (especially for the end-user) that the widget handles the renaming from "toto" to "toto2" if the file already exists.

Symfony\Component\Filesystem\Exception\IOException: Cannot rename because the target "/home/michael/Web/www.drupal/sites/all/custom/resources/company/orig/2419/614525296d80ce01a8610e7429b0ccca05f366b3551219612.jpg" already exists. - #0 /home/michael/Web/www.drupal/vendor/mouf/html.widgets.jqueryfileupload/src/Mouf/Html/Widgets/JqueryFileUpload/File.php(97): Symfony\Component\Filesystem\Filesystem->rename('/tmp/mouf_jquer...', '/home/michael/W...') #1 /home/michael/Web/www.drupal/vendor/mouf/mvc.bce.jquery-file-upload/src/Mouf/MVC/BCE/Classes/Descriptors/JqueryUploadMultiFileFieldDescriptor.php(152): Mouf\Html\Widgets\JqueryFileUpload\File->moveAndRename('/home/michael/W...', '614525296d80ce0...') #2 /home/michael/Web/www.drupal/vendor/mouf/mvc.bce/src/Mouf/MVC/BCE/BCEForm.php(283): Mouf\MVC\BCE\Classes\Descriptors\JqueryUploadMultiFileFieldDescriptor->postSave(Object(Wabel\Dao\Bean\CompanieBean), '2419', NULL) #3 /home/michael/Web/www.drupal/vendor/mouf/mvc.bce/src/Mouf/MVC/BCE/BCEFormInstance.php(59): Mouf\MVC\BCE\BCEForm->save(NULL) #4 /home/michael/Web/www.drupal/sites/all/custom/Wabel/Controllers/CompanyController.php(329): Mouf\MVC\BCE\BCEFormInstance->save() #5 [internal function]: Wabel\Controllers\CompanyController->save(NULL) #6 /home/michael/Web/www.drupal/vendor/mouf/integration.drupal.druplash/src/Mouf/Integration/Drupal/Druplash/Druplash.php(249): call_user_func_array(Array, Array) #7 /home/michael/Web/www.drupal/vendor/mouf/integration.drupal.druplash/src/Mouf/Integration/Drupal/Druplash/Druplash.php(194): Mouf\Integration\Drupal\Druplash\Druplash::callAction(Object(Wabel\Controllers\CompanyController), 'save', Array, Array, Array) #8 /home/michael/Web/www.drupal/sites/all/modules/druplash/druplash.module(43): Mouf\Integration\Drupal\Druplash\Druplash::executeAction(Array) #9 [internal function]: druplash_execute_action(Array) #10 /home/michael/Web/www.drupal/includes/menu.inc(517): call_user_func_array('druplash_execut...', Array) #11 /home/michael/Web/www.drupal/index.php(21): menu_execute_active_handler() #12 {main} in Symfony\Component\Filesystem\Filesystem->rename() (line 256 of /home/michael/Web/www.drupal/vendor/symfony/filesystem/Symfony/Component/Filesystem/Filesystem.php).