summaryrefslogtreecommitdiff
path: root/docs/cmdline-opts/form.d
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2017-10-12 14:25:59 +0100
committerPatrick Monnerat <patrick@monnerat.net>2017-10-12 14:25:59 +0100
commit665b3e48bc95713ecceaddf445fc2049440a6fb3 (patch)
tree17e6220116aee5201c5df39fa709d32c8e503511 /docs/cmdline-opts/form.d
parentf64c05278e5fcd9425c3389b5cee84aa211677dc (diff)
downloadgnurl-665b3e48bc95713ecceaddf445fc2049440a6fb3.tar.gz
gnurl-665b3e48bc95713ecceaddf445fc2049440a6fb3.tar.bz2
gnurl-665b3e48bc95713ecceaddf445fc2049440a6fb3.zip
cli tool: reimplement stdin buffering in -F option.
If stdin is not a regular file, its content is memory-buffered to enable a possible data "rewind". In all cases, stdin data size is determined before real use to avoid having an unknown part's size. --libcurl generated code is left as an unbuffered stdin fread/fseek callback part with unknown data size. Buffering is not supported in deprecated curl_formadd() API.
Diffstat (limited to 'docs/cmdline-opts/form.d')
-rw-r--r--docs/cmdline-opts/form.d9
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/cmdline-opts/form.d b/docs/cmdline-opts/form.d
index 4cc5f5a39..b3251bdb8 100644
--- a/docs/cmdline-opts/form.d
+++ b/docs/cmdline-opts/form.d
@@ -25,9 +25,12 @@ the form-field to which portrait.jpg will be the input:
curl -F profile=@portrait.jpg https://example.com/upload.cgi
To read content from stdin instead of a file, use - as the filename. This goes
-for both @ and < constructs. For this case, as well as for others in which the
-full data size cannot be determined before the transfer starts (as named pipes
-or similar), data is transferred as chunks by HTTP and rejected by IMAP.
+for both @ and < constructs. If stdin is not attached to a regular file, it is
+buffered first to determine its size and allow a possible resend. Defining a
+part's data from a named non-regular file (such as a named pipe or similar) is
+unfortunately not subject to buffering and will be effectively read at
+transmission time; since the full size is unknown before the transfer starts,
+data is sent as chunks by HTTP and rejected by IMAP.
You can also tell curl what Content-Type to use by using 'type=', in a manner
similar to: