Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lesliepound opened this issue Oct 11, 2014 · 4 comments

Comments

@lesliepound
Copy link

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!

@Dudemullet
Copy link
Contributor

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;
})

@brooklynb7
Copy link

Great feature! I'm using it. Thanks!

@Dudemullet
Copy link
Contributor

Thanks @brooklynb7. I really appreciate it 😁

@zhongdeming428
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants