473,513 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Content-Length" header

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.

Jul 18 '05 #1
2 3098
On 2004-08-30, Justin <ju************@hotmail.com> wrote:
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?

--
Grant Edwards grante Yow! If elected, Zippy
at pledges to each and every
visi.com American a 55-year-old
houseboy...
Jul 18 '05 #2
Justin wrote:
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
win32
import urllib
s = 'http://www.ecs.soton.ac.uk/~harnad/Temp/Ariadne-RAE.doc'
f = urllib.urlopen(s)
print f.info()

Date: 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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3930
by: Sugapablo | last post by:
In the following file below, I want it to return itself as a Rich Text Format file that populates the variables with data from the database. I set up the mime types and the filename accordingly....
10
3373
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include...
10
26177
by: Richard R Plourde | last post by:
Well, the error message... "Please, validate your XML document first! Line 1 Column 1 Content is not allowed in prolog." comes up when I try to verify my CSS...
21
21236
by: cman | last post by:
does anyone know why i can't generate images with: header("Content-type:image/jpeg"); imagejpeg($img_number); i've tried different examples but i always get a text output as if the header...
1
1751
by: Henry Law | last post by:
(I posted this to comp.infosystems.www.browsers.misc but there seems to be very little traffic there. I can't see another suitable group; is it on topic here? If not, any suggestions as to...
11
15065
by: Trapulo | last post by:
I've this statement in my output's creation: Response.Clear() Response.ContentType = "application/vnd.google-earth.kml+xml kml" Response.AddHeader("Content-Disposition", "inline;...
1
2267
by: dave8421 | last post by:
Hi, I'm trying to make sense of the definition for "Rendered Content" in current CR for CSS 2.1 Is rendered content what is displayed on the particular media or device? from the...
0
1260
by: wizofaus | last post by:
If you use your browser to navigate to http://www.fsa.gov.uk/register/, it will redirect you to http://www.fsa.gov.uk/register/home.do;jessionid= etc. etc. etc. But if you use WebRequest to fetch...
3
1347
by: davidiwharper | last post by:
Hello everyone, I'm learning Perl again! I am writing a CGI script that has two possible outcomes. So I have broken up the HTML output into four parts: Beginning (header and the start of the...
3
2387
by: K Viltersten | last post by:
I've been informed that a webserver sending a XML file is supposed to add "Content-Type: text/xml header". I'm not questioning that infromation but i'm unsure what was ment by it. The XML i get...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.