Newby Question: Check image size before getting with Net::Http

Dear Expert,

I want to check the file size of a URI to identify large files (I will
decide on threshold) without having to get the whole file first.

Can I get just the file size using something related to Net::Http
(don’t know if Propfind would help and if it does how).

Thanks in advance.
Ruchira

Hi,

2008/5/30 Ruchira B. [email protected]:

Dear Expert,

I want to check the file size of a URI to identify large files (I will
decide on threshold) without having to get the whole file first.

Can I get just the file size using something related to Net::Http
(don’t know if Propfind would help and if it does how).

require ‘net/http’

response = nil
Net::HTTP.start(‘www.biostat.wisc.edu’, 80) {|http|
response = http.head(‘/bcg/categories/languages/ruby/ruby_logo.png’)
}
p response[‘content-length’]

Regards,

Park H.

On May 30, 7:52 am, Heesob P. [email protected] wrote:

(don’t know if Propfind would help and if it does how).

Park H.

Thank you very much Park.
Ruchira