From: Travis D Warlick Jr Date: 2007-07-10T06:51:09+09:00 Subject: Re: Get file size before download (noobish question) John Joyce wrote: > > On Jul 9, 2007, at 3:31 AM, Taras Koval wrote: > >> Guest wrote: >>> Hi, >>> >>> so the subject implies what i want to do, get the file size before >>> downloading. i've seen posts about downloading the header, so if >>> possible, could someone give an example of this code??? >>> >>> also, for files without a header, i tried using :content_length_proc >>> within the open-uri class, but it would seem that the file is being >>> downloaded, then tested for size (from the difference in time for >>> running my code) >>> >>> so if someone has any ideas as to getting filesize of a file (mp3 >>> specifically) without a header... please help! >>> >>> >> That is not possible! >> > If you can ask the system the file is stored on, you can get its file size. It's not possible to ask for a file size/content-length over HTTP. Maybe FTP, Telnet, SSH, etc, but that's assuming you have a login and permissions to access the file. ************************************* * Travis D Warlick, Jr * Lead Developer * Operis Systems, LLC *************************************