max-filesize.md (1090B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Long: max-filesize 5 Arg: <bytes> 6 Help: Maximum file size to download 7 Protocols: FTP HTTP MQTT 8 Category: connection 9 Added: 7.10.8 10 Multi: single 11 See-also: 12 - limit-rate 13 Example: 14 - --max-filesize 100K $URL 15 --- 16 17 # `--max-filesize` 18 19 When set to a non-zero value, it specifies the maximum size (in bytes) of a 20 file to download. If the file requested is larger than this value, the 21 transfer does not start and curl returns with exit code 63. 22 23 Setting the maximum value to zero disables the limit. 24 25 A size modifier may be used. For example, Appending 'k' or 'K' counts the 26 number as kilobytes, 'm' or 'M' makes it megabytes, while 'g' or 'G' makes it 27 gigabytes. Examples: 200K, 3m and 1G. (Added in 7.58.0) 28 29 **NOTE**: before curl 8.4.0, when the file size is not known prior to 30 download, for such files this option has no effect even if the file transfer 31 ends up being larger than this given limit. 32 33 Starting with curl 8.4.0, this option aborts the transfer if it reaches the 34 threshold during transfer.