473,385 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

cgi script headers - help

hi!

i am generating a file on the fly and making a user download it.
print "Content-Type: application/model\n\n"
print "Content-Disposition: attachment; filename=modeldef3\n"
print str

i set the Content-Disposition to force a download dialog box and also give
the file a name.
however when i view the headers sent by my script, i have only
HTTP/1.1 200 OK
Date: Thu, 05 Aug 2004 02:26:48 GMT
Server: Apache/1.3.19 (Unix)
Connection: close
Content-Type: application/model

why isn't the Content-Disposition header coming up?

thanks

cheers

--
Ajay Brar,
CS Honours 2004
Smart Internet Technology Research Group

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Jul 18 '05 #1
2 1901
Ajay wrote:
hi!

i am generating a file on the fly and making a user download it.
print "Content-Type: application/model\n\n"
print "Content-Disposition: attachment; filename=modeldef3\n"
print str

i set the Content-Disposition to force a download dialog box and also give
the file a name.
however when i view the headers sent by my script, i have only
HTTP/1.1 200 OK
Date: Thu, 05 Aug 2004 02:26:48 GMT
Server: Apache/1.3.19 (Unix)
Connection: close
Content-Type: application/model

why isn't the Content-Disposition header coming up?


Probably because the previous line was terminated with three (3)
newlines, thus marking the end of the header section...

Note that print includes a newline normally, so including any
other newlines will result in at least a double newline, which
is the delimiter between header and body.

-Peter
Jul 18 '05 #2
thanks...that was it

--
Ajay Brar,
CS Honours 2004
Smart Internet Technology Research Group
Quoting Peter Hansen <pe***@engcorp.com>:
Ajay wrote:
hi!

i am generating a file on the fly and making a user download it.
print "Content-Type: application/model\n\n"
print "Content-Disposition: attachment; filename=modeldef3\n"
print str

i set the Content-Disposition to force a download dialog box and also

give
the file a name.
however when i view the headers sent by my script, i have only
HTTP/1.1 200 OK
Date: Thu, 05 Aug 2004 02:26:48 GMT
Server: Apache/1.3.19 (Unix)
Connection: close
Content-Type: application/model

why isn't the Content-Disposition header coming up?


Probably because the previous line was terminated with three (3)
newlines, thus marking the end of the header section...

Note that print includes a newline normally, so including any
other newlines will result in at least a double newline, which
is the delimiter between header and body.

-Peter
--
http://mail.python.org/mailman/listinfo/python-list

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Jul 18 '05 #3

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

Similar topics

3
by: Seagull Manager | last post by:
Running Apache 1.3, PHP 4.3, and WinXP, configured acc. to instructions on apache manual and php manual (as far as I can see), but getting "internal server error" in browser... log says "Premature...
2
by: Web Master | last post by:
Hi, I am having a little issue with Jacks Form mail php script. I have installed it and configured the form to get it to work, but for some bizarre reason I have 2 issues I can't seem to debug....
4
by: Ann | last post by:
Hi, I am trying to send a html email from a php script. This script emails a common information to all the members in the database. The only problem is I cannot specify colors, hyperlinks...
6
by: Paul Winkler | last post by:
This is driving me up the wall... any help would be MUCH appreciated. I have a module that I've whittled down into a 65-line script in an attempt to isolate the cause of the problem. (Real...
1
by: Wayne Deleersnyder | last post by:
Hi, I'm a newbie at Perl and CGI and hoping someone can point me in the right direction. Recently I've been going through an older book I have on CGI programming to get a start. Most of it...
4
by: D Newsham | last post by:
Hi, This javascript creates a table that has a header and side column that do not move while scrolling through the table. I need to convert this to vb script. Can anybody help, or do you have...
1
by: Piotrekk | last post by:
Hi My application is uploading the file to the ASP script. I am dealing with situation where ASP script is not interested in receiving a file. I simulate this by returning from ASP script: ...
2
chunk1978
by: chunk1978 | last post by:
i wrote a custom PHP script last year and everything worked perfectly... recently my webserver upgraded to PHP 5 and now my script doesn't work properly. what the script does is: users fill out...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
7
by: jeddiki | last post by:
Hi, As I am in Turkey at present, I can not see vidoes on youtube. So I have tried a few proxies but keep finding them slow or not working. So I have installed myphpProxy on my server under...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.