Upload one local file to an FTP server with curl
Build a paste-ready command, then review its compatibility and effects before running it.
curl --fail --show-error --user <username> --upload-file <local-file> ftp://<host>/incoming/Complete required fields to copy the generated command.
Compatibility
Remote writeThe destination directory must already exist unless --ftp-create-dirs is added deliberately.
Operational knowledgereview due 2027-01-19
Requirementscurlcurl must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportcurl Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals% Total % Received % Xferd Average Speed Time Time Time CurrentRepresentative successful output; values vary with the selected target and system state.
Known errorscurl: command not foundcurl is missing or is not available on PATH.
Verifycurl --fail --show-error --user {{user}} --upload-file {{localFile}} ftp://{{host}}/{{remotePath}}/Re-run the corresponding read-only inspection and confirm the intended state.Rollback noteNo universal automatic rollback is available. Capture the current state and use the tool-specific recovery procedure before applying changes.
Command breakdown
01curlCommandRuns the curl stage of this one-liner.
02--failOptionReturns a failure status when the server reports an FTP or HTTP error.
03--show-errorOptionKeeps transfer errors visible when curl is also used in silent mode.
04--userOptionSupplies the FTP username; curl prompts for a password when it is omitted.
05<username>ParameterA value supplied in the Fill parameters section.
06--upload-fileOptionReads the following local file and uploads it to the destination URL.
07<local-file>ParameterA value supplied in the Fill parameters section.
08ftp://<host>/ParameterA value supplied in the Fill parameters section.
09<remote-path>/ParameterA value supplied in the Fill parameters section.
Example input
curl --fail --show-error --user alice --upload-file release.tar.gz ftp://ftp.example.com/incoming/
Example output
% Total % Received % Xferd Average Speed Time Time Time Current
100 42.8M 0 0 100 42.8M 0 16.9M 0:00:02 0:00:02 --:--:-- 16.9M
Illustrative output — exact values vary by system and data.
Official sources
Related commands