Size of a remote URL

J

Justin

I am attempting to create a tuple of file sizes from a list or URLs.
Unfortunately not all files are returned with a "Content-Length"
header. Does anybody knwo a more absolute or reliable way to get the
size of a remote file through its URL? Possibly a lower level http
request than simply reading the MIME headers? Thanks to anyone who has
a suggestion

-Justin
 
D

Dave Brueck

Justin said:
I am attempting to create a tuple of file sizes from a list or URLs.
Unfortunately not all files are returned with a "Content-Length"
header. Does anybody knwo a more absolute or reliable way to get the
size of a remote file through its URL? Possibly a lower level http
request than simply reading the MIME headers? Thanks to anyone who has
a suggestion

If the server won't tell you the size of the object, then the only other
thing you can do is download the object yourself and compute its size -
there's nothing else you can do.

The size is often not reported if the content is being generated on the
fly. Anyway, maybe there's another way to solve the problem you're
working on - why do you need to know the sizes?

-Dave
 

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
474,204
Messages
2,571,065
Members
47,672
Latest member
svaraho

Latest Threads

Top