From: Heesob Park Date: 2008-05-30T11:52:49+09:00 Subject: Re: Newby Question: Check image size before getting with Net::Http Hi, 2008/5/30 Ruchira Bomiriya : > 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