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

Open
opened 2026-01-19 18:29:03 +00:00 by michael · 2 comments
Owner

Originally created by @anihm136 on GitHub.

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
Originally created by @anihm136 on GitHub. 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
Author
Owner

@anihm136 commented on GitHub:

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.

@anihm136 commented on GitHub: 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.
Author
Owner

@paolafrancesca commented on GitHub:

thanks @anihm136

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

thanks

@paolafrancesca commented on GitHub: thanks @anihm136 since you are already working on the POST handler do you mind implementing solution 1? :) thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#123