"Content-Length" header

J

Justin

I have a program that downloads files from the web. There are
instances in which a .info() will not return a "Content-length" header
to me. Is ther a way to specifically request this header or FORCE it
to be sent? I know there is some way to get the file size for these
files because Internet Explorer is capable of determining the size on a
cut / paste of the same exact url.
 
G

Grant Edwards

I have a program that downloads files from the web. There are
instances in which a .info() will not return a "Content-length" header
to me. Is ther a way to specifically request this header or FORCE it
to be sent? I know there is some way to get the file size for these
files because Internet Explorer is capable of determining the size on a
cut / paste of the same exact url.

Didn't like the answers you were getting in the other thread?
 
P

Peter Hansen

Justin said:
I have a program that downloads files from the web. There are
instances in which a .info() will not return a "Content-length" header
to me. Is ther a way to specifically request this header or FORCE it
to be sent? I know there is some way to get the file size for these
files because Internet Explorer is capable of determining the size on a
cut / paste of the same exact url.

Was this URL one of them?

c:\>python
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on
win32Date: Mon, 30 Aug 2004 19:50:49 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12
OpenSSL/0.9.6b DAV/
1.0.3 PHP/4.3.2 mod_perl/1.26
Last-Modified: Sun, 20 Apr 2003 15:19:42 GMT
ETag: "f10f630-9a800-3ea2ba8e"
Accept-Ranges: bytes
Content-Length: 632832
Connection: close
Content-Type: application/msword


Seems like it works for me. Maybe you have another URL which doesn't
work for urlopen, but for which IE does actually display a percentage
progress bar?

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top