transfer.sh
transfer.sh copied to clipboard
how can delete a my file with curl
Hi, the procedure described below works for me: https://github.com/dutchcoders/transfer.sh#x-url-delete https://github.com/dutchcoders/transfer.sh#deleting
Where do you stuck?
and if we upload without run this grep part, how to delete the file without this specific header value !?
@bahammut there's no way without knowing the delete token
if you uploaded on transfer.sh you can try asking @stefanbenten
You can always reach out via the contact-us form on the website and we'll be happy to help with getting files deleted, if proven ownership of the file exists 👍
It's very easy to forget to grep the file because grep is not included in the getting started command.
Would it be a good idea to show the deleted url in upload response? Like:
curl --upload-file ./hello https://transfer.sh/hello.txt
Download URL: https://transfer.sh/hello.txt/BAYh0/hello.txt
Delete URL: https://transfer.sh/hello.txt/BAYh0/hello.txt/PDw0NHPcqU
@reorx unluckily change the output of the command will be a breaking change that we are not willing to do
maybe we can improve te documentation in the getting started command: any suggestion is welcome
You are right, there must be many scripts that relies on the output to parse the download url.
My suggestion to document is to add a -v after curl, making the command
looks like below:
curl -v —upload-file hello https://transfer.sh/hello.txt
On Mon, Sep 19, 2022 at 13:27 Andrea Spacca @.***> wrote:
@reorx https://github.com/reorx unluckily change the output of the command will be a breaking change that we are not willing to do
maybe we can improve te documentation in the getting started command: any suggestion is welcome
— Reply to this email directly, view it on GitHub https://github.com/dutchcoders/transfer.sh/issues/502#issuecomment-1250585622, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADDDVE2NPYUNQEXLMWRYWDV672VXANCNFSM57BMEOBQ . You are receiving this because you were mentioned.Message ID: @.***>
-- Xiao Meng
I have for a while trying to figure out the delete token.
Is there a way to show regular and delete token in one curl command?
When i use curl -sD - --upload-file test.txt https://transfer.sh/test.txt | grep "x-delete-token" i only the delete token in a whole link. But i would like to have one url and one line with token only.
Sorry but I'm new to the whole curl and grep thing.
UPDATE: ended up with this in my fish shell function
curl -sD - --upload-file $argv https://transfer.sh/$argv | grep 'transfer' | awk -F'/' 'NR==1{print "Delete Token: "$6};END{print $0}'
this is what i use in termux function so i can copy to clipboard but also see the url and delete token in the teminal -
curl -sD - --upload-file $argv https://transfer.sh/$argv | grep 'transfer' | awk -F'/' 'NR==1{print "Delete Token: "$6};END{print $0}' > curl_transfer.log && tail -n1 curl_transfer.log | sed -z 's/\n$//' | termux-clipboard-set && cat curl_transfer.log
and this is for use on my linux computer (i have this as a IF function all togather).
curl -sD - --upload-file $argv https://transfer.sh/$argv | grep 'transfer' | awk -F'/' 'NR==1{print "Delete Token: "$6};END{print $0}' > curl_transfer.log && tail -n1 curl_transfer.log | xclip -sel clip 2>/dev/null; cat curl_transfer.log
if someone was intrested on how i did it. Please give feedback is something is off or could have done better.
@Dan1jel , @reorx
you might want to give a look at the sample bash/zsh function on the readme https://github.com/dutchcoders/transfer.sh#bash-and-zsh-with-delete-url-delete-token-output-and-prompt-before-uploading :)
@Dan1jel if it doesn't not work for fish and you are able to improve, you're welcome to open a PR :)
@Dan1jel , @reorx
you might want to give a look at the sample bash/zsh function on the readme https://github.com/dutchcoders/transfer.sh#bash-and-zsh-with-delete-url-delete-token-output-and-prompt-before-uploading :)
@Dan1jel if it doesn't not work for fish and you are able to improve, you're welcome to open a PR :)
Did not see that, thanks for the tip, dont know if i would be able to do better tho, my thought was to make an zip to upload instead of several files, thats why my line is small and minimalist but yea, that sample was really nice :)