jquery-file-upload-middleware icon indicating copy to clipboard operation
jquery-file-upload-middleware copied to clipboard

Is there a cnfiguration variable... to overwrite any existing files/images of same filename?

Open lesliepound opened this issue 11 years ago • 4 comments

Now a new file is created imagefile(1).png when the image already exists. Can I set a config somewhere to overwrite this action and just replace imagefile.png with the just the latest uploaded one?

Thanks! Love the package!

lesliepound avatar Oct 11 '14 21:10 lesliepound

I couldn't find a configuration for that and I think it could be helpful so I've created a pull request that adds a configuration option via the force flag. This option would let you overwrite files with the same name in the upload directory. In case the contributors don't want this functionality or an easy fix you could do in the meantime is:

upload.on("begin", function(fileInfo) { 
  fileInfo.name = fileInfo.originalName;
})

Dudemullet avatar Oct 15 '14 11:10 Dudemullet

Great feature! I'm using it. Thanks!

brooklynb7 avatar Jul 13 '15 07:07 brooklynb7

Thanks @brooklynb7. I really appreciate it 😁

Dudemullet avatar Jul 15 '15 03:07 Dudemullet

Great Q&A, Helped me a lot,Thx!

zhongdeming428 avatar Apr 29 '18 08:04 zhongdeming428