473,569 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ 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 1863
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...@ya hoo.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
3999
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 doesn't exist. For example: input: ... download.php?name=virtualdub_1.4.9.zip
2
1429
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 seperation string to stdout. The loading was done in parallel. (I used processes for this.) The script was started by the following command:
2
2230
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 minutes from 15 to 130) downloading a 150 MB BINARY file (a big gzipped ascii file) with the traceback reported below. IMVHO this is not a...
14
1872
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 type of the downloadable file
1
1238
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 what is output onto the page: <span id="javascriptLabel"> <script language="javascript"> <!--
3
2616
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 running into some PHP behavior that I do not understand in PHP 5.1.2. I need to parse the HTML from the following carefully constructed URI:
1
1889
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 search criteria 2) Click on Download button to go to download page 3) Click on Download button on Download page 4) Server sends 2 bits of data to...
1
47389
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8125
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2114
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 we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.