473,469 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Strange download script problem

I have a php script which generates a zip file that contains an ASCII
text file. The script then prompts the user to save/open the zip file.
The script is on a server that is behind an Apache proxy server. Using
Firefox, the download works fine and everything goes as intended.
However, IE7 tries to download the php script instead of the zip file,
resulting in an access error.

Below are the pertinent portions of the script.

Any help is greatly appreciated.

Raffi

--------------------------------------------------------------------------------------------------------

$file_name = "/tmp/Export.zip";

$size = filesize($file_name);

//Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=Export.zip");
header("Content-Length: $size");
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: binary");

//Read the file from disk
readfile($file_name);

Jul 29 '07 #1
2 1856
Raffi wrote:
I have a php script which generates a zip file that contains an ASCII
text file. The script then prompts the user to save/open the zip file.
The script is on a server that is behind an Apache proxy server. Using
Firefox, the download works fine and everything goes as intended.
However, IE7 tries to download the php script instead of the zip file,
resulting in an access error.

Below are the pertinent portions of the script.

Any help is greatly appreciated.

Raffi

--------------------------------------------------------------------------------------------------------

$file_name = "/tmp/Export.zip";

$size = filesize($file_name);

//Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=Export.zip");
header("Content-Length: $size");
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: binary");

//Read the file from disk
readfile($file_name);
See
http://www.evolt.org/article/Using_M...eets/20/26896/
Jul 29 '07 #2
This is similar to your case:

http://in.php.net/manual/en/function.header.php#73416

On Jul 29, 10:46 am, Raffi <thegrizz...@yahoo.comwrote:
I have a php script which generates a zip file that contains an ASCII
text file. The script then prompts the user to save/open the zip file.
The script is on a server that is behind an Apache proxy server. Using
Firefox, the download works fine and everything goes as intended.
However, IE7 tries to download the php script instead of the zip file,
resulting in an access error.

Below are the pertinent portions of the script.

Any help is greatly appreciated.

Raffi

--------------------------------------------------------------------------------------------------------

$file_name = "/tmp/Export.zip";

$size = filesize($file_name);

//Set headers
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=Export.zip");
header("Content-Length: $size");
header("Content-Type: application/zip");
header("Content-Transfer-Encoding: binary");

//Read the file from disk
readfile($file_name);

Jul 29 '07 #3

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

Similar topics

7
by: Kornelius Finkenbein | last post by:
Hello folks! I've got a strange problem with my download-script in conjunction with M$ internet explorer, if the filename I want to link to includes more than one points. In Netscape the problem...
2
by: Markus Franz | last post by:
Hi. Today I created a script called load.py for using at the command line written in Python 2.3. This script should load as many websites as given on the comand line and print them with a...
2
by: siggy2 | last post by:
Hi, I'm using Python 2.3.4 (#53, May 25 2004, 21:17:02) on win32 I've noticed a strange (= not deterministic) behaviour of ftplib.py: sometimes (not always) it fails (after a variable number of...
14
by: James Wong | last post by:
Hi! everybody, I'm facing a quite strange download problem. I use the following code to download an XML file to client side: With Response ' clear buffer Call .Clear() ' specify the...
1
by: Melissa | last post by:
I have inherited an intranet ASP.NET (C#) page running on Windows 2000. The page populates a label control with some javascript to open a pop-up to a document (xls, doc, pdf, etc.). This is...
3
by: Chuck Renner | last post by:
Please help! This MIGHT even be a bug in PHP! I'll provide version numbers and site specific information (browser, OS, and kernel versions) if others cannot reproduce this problem. I'm...
1
by: Blackstar | last post by:
I have a website I am trying to download a file from. This website is strange in the fact that there is no direct link to the URL of the file. The way the site works is as follows: 1) Enter in...
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...
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:
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.