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

Check if file already exists #8

Open
NicolasRitouet opened this issue Jun 2, 2014 · 2 comments
Open

Check if file already exists #8

NicolasRitouet opened this issue Jun 2, 2014 · 2 comments

Comments

@NicolasRitouet
Copy link
Owner

If a file with the same name already exists, we should handle that:

  • throw an error
    or
  • append (n) at the end of the file

Check should probably be before this line. https://github.com/NicolasRitouet/dpd-fileupload/blob/master/index.js#L117

@EvilDrW
Copy link
Contributor

EvilDrW commented Oct 29, 2015

A couple of other alternatives are

  1. to save the file as a different name when it's uploaded (maybe just use the deployd ID as the faux filename) and store the original filename in the db.
  2. replace the existing file with the new one

@NicolasRitouet
Copy link
Owner Author

I'm personally not a big fan of replacing the existing file (maybe a param that you could pass).
The default behaviour could be to append a number at the end of the file and with a param, you could be able to replace the existing file.
Any other opinion from "the community"?

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

No branches or pull requests

2 participants