Artifactspublic-v0

curl

master
ply4 git calls547 ms288 KiB2 cachedprotocol v2
63 lines2.3 KiBRaw

--upload-file

Upload the specified local file to the remote URL.

If there is no file part in the specified URL, curl appends the local file name to the end of the URL before the operation starts. You must use a trailing slash (/) on the last directory to prove to curl that there is no filename or curl thinks that your last directory name is the remote filename to use.

When putting the local filename at the end of the URL, curl ignores what is on the left side of any slash (/) or backslash (\\) used in the filename and only appends what is on the right side of the rightmost such character.

Use the filename - (a single dash) to use stdin instead of a given file. Alternately, the filename . (a single period) may be specified instead of - to use stdin in non-blocking mode to allow reading server output while stdin is being uploaded.

If this option is used with an HTTP(S) URL, the PUT method is used.

You can specify one --upload-file for each URL on the command line. Each --upload-file + URL pair specifies what to upload and to where. curl also supports globbing of the --upload-file argument, meaning that you can upload multiple files to a single URL by using the same URL globbing style supported in the URL. Example:

curl --upload-file 'file{1,2,3}' ftp://ftp.example/

Since curl 8.21.0, you can use parts of the upload filename when it uses globbing by setting a glob name and referencing that in the same way you reference named URL globs. For example, if you upload three files to a single fixed HTTP URL and want to save the corresponding responses in separate files:

curl -T 'file{<num>1,2,3}' \
  https://upload.example/ -o 'response-#<num>'

When uploading to an SMTP server (aka "sending email"): the uploaded data is assumed to be RFC 5322 formatted. It has to feature the necessary set of headers and mail body formatted correctly by the user as curl does not transcode nor encode it further in any way.

1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Long: upload-file
5Short: T
6Arg: <file>
7Help: Transfer local FILE to destination
8Category: important upload imap
9Added: 4.0
10Multi: per-URL
11See-also:
12 - get
13 - head
14 - request
15 - data
16Example:
17 - -T file $URL
18 - -T "img[1-1000].png" ftp://ftp.example.com/
19 - --upload-file "{file1,file2}" $URL
20 - -T file -T file2 $URL $URL
21---
23# `--upload-file`
25Upload the specified local file to the remote URL.
27If there is no file part in the specified URL, curl appends the local file
28name to the end of the URL before the operation starts. You must use a
29trailing slash (`/`) on the last directory to prove to curl that there is no
30filename or curl thinks that your last directory name is the remote filename
31to use.
33When putting the local filename at the end of the URL, curl ignores what is on
34the left side of any slash (`/`) or backslash (`\\`) used in the filename and
35only appends what is on the right side of the rightmost such character.
37Use the filename `-` (a single dash) to use stdin instead of a given file.
38Alternately, the filename `.` (a single period) may be specified instead of
39`-` to use stdin in non-blocking mode to allow reading server output while
40stdin is being uploaded.
42If this option is used with an HTTP(S) URL, the PUT method is used.
44You can specify one --upload-file for each URL on the command line. Each
45--upload-file + URL pair specifies what to upload and to where. curl also
46supports globbing of the --upload-file argument, meaning that you can upload
47multiple files to a single URL by using the same URL globbing style supported
48in the URL. Example:
50 curl --upload-file 'file{1,2,3}' ftp://ftp.example/
52Since curl 8.21.0, you can use parts of the upload filename when it uses
53globbing by setting a glob name and referencing that in the same way you
54reference named URL globs. For example, if you upload three files to a single
55fixed HTTP URL and want to save the corresponding responses in separate files:
57 curl -T 'file{<num>1,2,3}' \
58 https://upload.example/ -o 'response-#<num>'
60When uploading to an SMTP server (aka "sending email"): the uploaded data is
61assumed to be RFC 5322 formatted. It has to feature the necessary set of
62headers and mail body formatted correctly by the user as curl does not
63transcode nor encode it further in any way.
Diagnostics4 git calls · 547 ms
CallStatusSizeTime0547 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=542
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2001.2 KiB542 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=1249
git.response.cache=MISS
git.response.duration_ms=542
git.fetch.wants=030fe96771c9ad725ec229faa025302a7422b650
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=1249
git.pkt.payload.max=1228
git.sideband.band1.bytes=1227
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e308f75b1015db
Request
a9d147ef…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format