473,797 Members | 3,162 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Internet Explorer 6 refusing to let me download

Hi,

This problem only affects PC IE. On a secured page (a page visited via
https), there is a link that reads -- "Download HTML File". The link
connects to this page

<?php
require("../../util_fns.php");

session_start() ;

$user_id = $_REQUEST[USER_ID_PARAM];
$file_contents = generateLoginFi le($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_co ntents));
header('Content-Disposition: attachment; filename="' .
str_replace("%s ", getCompanyName( $user_id), AUTO_LOGIN_FILE _TITLE) .
'.html"');

print $file_contents;
?>

However, on Internet Explorer, when I'm prompted to save the file, I
click "Save" and then get an error message stating, "Internet Explorer
cannot download ...ate_login_fi le.php?UserId=2 from
mysite.mydomain .com.

Internet Explorer was not able to open the Internet site. The
requested site is either unavailable or cannot be found. Please try
again later."

Is there something wrong iwth one of the headers I'm sending? I'm
using PHP 4.4.4.

Thanks, - Dave

Oct 25 '06 #1
3 11498
On 25 Oct 2006 15:24:54 -0700, "la***********@ zipmail.com"
<la***********@ zipmail.comwrot e:
>This problem only affects PC IE. On a secured page (a page visited via
https), there is a link that reads -- "Download HTML File". The link
connects to this page

<?php
require("../../util_fns.php");

session_start() ;

$user_id = $_REQUEST[USER_ID_PARAM];
$file_contents = generateLoginFi le($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_co ntents));
header('Content-Disposition: attachment; filename="' .
str_replace("% s", getCompanyName( $user_id), AUTO_LOGIN_FILE _TITLE) .
'.html"');

print $file_contents;
?>

However, on Internet Explorer, when I'm prompted to save the file, I
click "Save" and then get an error message stating, "Internet Explorer
cannot download ...ate_login_fi le.php?UserId=2 from
mysite.mydomai n.com.

Internet Explorer was not able to open the Internet site. The
requested site is either unavailable or cannot be found. Please try
again later."

Is there something wrong iwth one of the headers I'm sending? I'm
using PHP 4.4.4.
session_start() by default sends a cache control header including "no-store".
Internet Explorer takes this a bit too literally, but doesn't have appropriate
error handling for the case, and as a result explodes cryptically when you
attempt to save the output page to disk.

Before session_start() , add "session_cache_ limiter('none') ;", or look up that
function and tweak the limiter as appropriate (probably 'private' is closer to
the mark).

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 25 '06 #2
"la***********@ zipmail.com" <la***********@ zipmail.comwrot e:
>
This problem only affects PC IE. On a secured page (a page visited via
https), there is a link that reads -- "Download HTML File". The link
connects to this page

<?php
require("../../util_fns.php");

session_start() ;

$user_id = $_REQUEST[USER_ID_PARAM];
$file_contents = generateLoginFi le($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_co ntents));
header('Content-Disposition: attachment; filename="' .
str_replace("% s", getCompanyName( $user_id), AUTO_LOGIN_FILE _TITLE) .
'.html"');
Your headers are lying. You are not sending text/html content. IE can be
somewhat picky about the headers. Try this:

header('Content-Type: application/download');
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 26 '06 #3
Wow, you're good. Adding

session_cache_l imiter('none');

prior to the session_start() directive worked.

Thanks, - Dave

Andy Hassall wrote:
On 25 Oct 2006 15:24:54 -0700, "la***********@ zipmail.com"
<la***********@ zipmail.comwrot e:
This problem only affects PC IE. On a secured page (a page visited via
https), there is a link that reads -- "Download HTML File". The link
connects to this page

<?php
require("../../util_fns.php");

session_start() ;

$user_id = $_REQUEST[USER_ID_PARAM];
$file_contents = generateLoginFi le($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_co ntents));
header('Content-Disposition: attachment; filename="' .
str_replace("%s ", getCompanyName( $user_id), AUTO_LOGIN_FILE _TITLE) .
'.html"');

print $file_contents;
?>

However, on Internet Explorer, when I'm prompted to save the file, I
click "Save" and then get an error message stating, "Internet Explorer
cannot download ...ate_login_fi le.php?UserId=2 from
mysite.mydomain .com.

Internet Explorer was not able to open the Internet site. The
requested site is either unavailable or cannot be found. Please try
again later."

Is there something wrong iwth one of the headers I'm sending? I'm
using PHP 4.4.4.

session_start() by default sends a cache control header including "no-store".
Internet Explorer takes this a bit too literally, but doesn't have appropriate
error handling for the case, and as a result explodes cryptically when you
attempt to save the output page to disk.

Before session_start() , add "session_cache_ limiter('none') ;", or look up that
function and tweak the limiter as appropriate (probably 'private' is closer to
the mark).

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 26 '06 #4

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

Similar topics

1
2122
by: | last post by:
I have a question... With Internet Explore: How do I get VB.Net to respond to a Download Dialog Box in Internet Explorer? Example I need VB.Net to activate the window then select "Save"... Thank you... Kirk
3
2355
by: VK | last post by:
Internet Explorer 7 beta 2 preview CNET Editor review: <http://reviews.cnet.com/Internet_Explorer_7_for_XP_SP2_Beta_2/4505-3514_7-31454661-2.html?tag=nl.e415> Summary (my personal review interpretation): "Half stolen from Firefox, half is buggy - including the stolen part". Download: <http://www.download.com/Internet-Explorer-7/3000-2356_4-10497433.html?tag=nl.e415>
2
6242
by: Yuv | last post by:
Hi, When one of my users are navigating my ASP website, and click on submit type button to move from Page1.asp to another ASP page, Page2.asp, they are getting message like "Internet explorer cannot download <asp pagefrom <server>. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later."
2
2824
by: =?Utf-8?B?YW5ub3llZCB3aXRoIHZpc3Rh?= | last post by:
I have a new Toshiba Satellite laptop. It came with Vista and IE 7. When I close an Exporer window (using the X in the corner) I get a message that says "Internet Explorer has stopped working and windows is trying to fix the problem" It thinks for a few seconds and then another box dialog box pops up and says "Internet Explorer is restarting" It then shuts down every IE window I have open and restarts. I also found that it does that...
0
2912
by: Christian W Larsen | last post by:
I want to export a datagrid to Excel. Here is the code: Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=FileName.xls"); Response.ContentType = "application/vnd.ms-excel";
1
3102
by: Christian W Larsen | last post by:
I want to export a datagrid to Excel. Here is the code: Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition",
2
3239
by: cwlarsen | last post by:
I want to export a datagrid to Excel. Here is the code: Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition",
2
3174
by: =?Utf-8?B?U1VOTlk=?= | last post by:
Hi I have a web application(website) from which i generate reports. I code behind used is asp.net. When i give a small date range to generate reports it works fine, but when i give a big date range i am shown a Error Message: Internet Explorer cannot download <file namefrom <server> Internet Explorer was not able to open the Internet site. The requested site is either unavailable or cannot be found. Please try again later. Am sure the...
1
7453
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/scripts/demo/download2.php Whenever I get that page, I get the following error: --------------------- Internet Explorer cannot download download2.php from www.frostjedi.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10246
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10023
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7560
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
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
3
2934
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.