dutchcoders / dutchcoders/transfer.sh

File overwritten when multiple files with same name uploaded via POST

Open
#464 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.