Find the answer to your Linux question:
Results 1 to 2 of 2
hi, can anybody tell me how to retrieve the size of a file/data before actually downloading from server by using curl. thanx in advace....
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    9

    curl

    hi,

    can anybody tell me how to retrieve the size of a file/data before actually downloading from server by using curl.

    thanx in advace.

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    658
    from the curl man page

    -I/--head
    (HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature
    the command HEAD which this uses to get nothing but the header
    of a document. When used on a FTP or FILE file, curl displays
    the file size and last modification time only.

    If this option is used twice, the second will again disable
    header only.
    Does that do what you need?

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...