curl
Upload and Download
Transfer files to and from a server.
By EZ4Code Team
uploaddownloadfile
Code
# Download to a named file
curl -o file.zip https://example.com/file.zip
# Download keeping the remote filename
curl -O https://example.com/file.zip
# Resume an interrupted download
curl -C - -O https://example.com/bigfile.iso
# Upload via multipart form
curl -F "[email protected]" https://example.com/upload
# Upload raw file with PUT
curl -T data.bin https://example.com/files/data.binExplanation
Use -o to name the output file or -O to keep the remote filename, and -C - to resume a partial download. -F uploads a multipart form field, prefixing the file path with @, which is how browsers upload files. -T streams a file as the PUT request body, suitable for RESTful file storage.