transfer.sh icon indicating copy to clipboard operation
transfer.sh copied to clipboard

Allow pushing files via POST

Open carl-unique opened this issue 9 months ago • 7 comments

Im trying to push files via busybox wget (curl is not available), this thing does not know PUT, but has --post-data / --post-file parameters, .. but im always getting 405 not allowed. Thanks!

carl-unique avatar Feb 09 '26 12:02 carl-unique

i hope #666 is not an evil request.

carl-unique avatar Feb 09 '26 12:02 carl-unique

@carl-unique POST requests have to be made to / (https://github.com/dutchcoders/transfer.sh/blob/main/server/server.go#L527)

francescayeye avatar Feb 09 '26 13:02 francescayeye

i tried to do:

wget -S --post-file /tmp/testfile.txt https://transfer.my.server/
or
wget -S --post-file /tmp/testfile.txt https://transfer.my.server

but got

>   HTTP/1.1 500 Internal Server Error

on server i got:

[transfer.sh]2026/02/09 20:44:12 request Content-Type isn't multipart/form-data
[transfer.sh]2026/02/09 20:44:12 10.11.12.13:0 - - [2026-02-09T20:44:12Z] "POST / HTTP/1.1" 500  "" "Wget"

carl-unique avatar Feb 09 '26 21:02 carl-unique

@carl-unique it's written in the server logs: "request Content-Type isn't multipart/form-data", you must send a multipart/form-data request for POST, check on wget manual how to do it :)

francescayeye avatar Feb 10 '26 12:02 francescayeye

i think the busybox image (which only knows wget) is not able to send multipart/form-data. I can help myself by just re-building the images and add curl, but it seems there are a few very minimum images out there which do not support this out of the box. Thanks anyway for pointing me to the right hint. :) Thanks!

carl-unique avatar Feb 16 '26 14:02 carl-unique

@carl-unique why do you make a request from a docker image? if the image you run transfer.sh from (assuming you do that) is reachable on the network (whatever public or private) you can just use curl from your shell. also do you mount in the busybox image the file you want to upload? it seems to me just a little strange workflow :)

francescayeye avatar Feb 16 '26 16:02 francescayeye

im using postgres:17-alpine .. i wanted to make a database snapshot and send it to transfer.sh internally to be able to move it to another install, .. so i most probably will just use another postgres image which has curl. no problem. :)

carl-unique avatar Feb 17 '26 09:02 carl-unique