3

How can I know the file size of the downloaded file before downloading it?

Flyk
  • 1,549
LanceBaynes
  • 4,090
  • I am not sure can you. Can you give a clearer example? What browser are you using? – slotishtype Jun 06 '11 at 19:27
  • 1
    I think you should at least specify the protocol in your question, because you can download files in many ways: over HTTP, FTP, rsync, scp, bittorrent etc – vtest Jun 06 '11 at 20:13

1 Answers1

8

You can use the following command:

curl --head <url>

where <url> is the URL of the file you want. The response will be only the headers of the HTTP response, which may include the file size if is known by the server.

goedson
  • 936