How to upload a file in a url via curl?

I have an image in a URL like and I want to send it over to be stored at Could I send it directly as a URL instead of a file from a path? I tried the below but it only stores the image URL.

curl -H "Authorization: Bearer eyJhbGciOiJIwetertyrtyUzI1NiIsInR5cCI6Ikp" -H "Content-Type: image/png" --data "" --url ""

I’m using windows curl

This command actually uploads the string

You first want to fetch your file then send it, like that :

curl | curl -H "Authorization: Bearer eyJhbGciOiJIwetertyrtyUzI1NiIsInR5cCI6Ikp" -H "Content-Type: image/png" --data-binary "@-" --url ""

The first thing just download the file, then it’s | piped into the input of the second one, note the --data-binary @-, @ means “Read content from a file” rather than actually reading the string and - is the STD, here stdin (whats coming from pipe).

This require | to work correctly (work like on bash) so you should use mingw, or WSL2. :slight_smile:

Awesome! Thanks to you I managed to upload it.

And also, I supposed to do this programmatically using PHP, could it support the pipe symbol? OR should I just call the curl twice? First to download the file and second to upload to ipfs?