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

File overwritten when multiple files with same name uploaded via POST #464

Open
anihm136 opened this issue Jan 16, 2022 · 2 comments
Open

Comments

@anihm136
Copy link
Contributor

anihm136 commented Jan 16, 2022

When multiple files of the same name are uploaded via POST method, transfer.sh overwrites all of them with the last uploaded file. This happens because all the files uploaded in a single POST request get a single UID in the URL, and are named based on the upload name.
How to replicate:

  1. Upload two files with the same name but different contents (for example, a/foo.txt and b/foo.txt in a single POST request
  2. Open the returned URLs

Expected outcome:
The two uploaded files are different

Actual outcome:
The uploaded files are the same, with one overwriting the other

Possible solutions:

  1. Generate a separate UID for each file in a POST request
  2. Add another unique random string to the filename so that the upload URL is different
@aspacca
Copy link
Collaborator

aspacca commented Jan 16, 2022

thanks @anihm136

since you are already working on the POST handler do you mind implementing solution 1? :)

thanks

@anihm136
Copy link
Contributor Author

Sure, will do. Might take some time depending on my schedule, so do let me know if anyone else wants to take it up in the meantime.

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

2 participants