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,

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 Heesob

···

2008/5/30 Ruchira Bomiriya <ruchira.bomiriya@gmail.com>:

Thank you very much Park.
Ruchira

···

On May 30, 7:52 am, Heesob Park <pha...@gmail.com> wrote:

Hi,

2008/5/30 Ruchira Bomiriya <ruchira.bomir...@gmail.com>:

> 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 Heesob