473,503 Members | 2,105 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 = generateLoginFile($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_contents));
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_file.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 11480
On 25 Oct 2006 15:24:54 -0700, "la***********@zipmail.com"
<la***********@zipmail.comwrote:
>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 = generateLoginFile($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_contents));
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_file.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.uk :: 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.comwrote:
>
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 = generateLoginFile($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_contents));
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_limiter('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.comwrote:
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 = generateLoginFile($user_id);

header('Content-Type: text/html');
header('Content-Length:' . strlen($file_contents));
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_file.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.uk :: 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
2114
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"... ...
3
2322
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...
2
6220
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...
2
2807
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...
0
2890
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");...
1
3089
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
3213
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
3156
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...
1
7425
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...
0
7091
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
7342
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
7464
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
5586
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
5018
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
4680
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
3171
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
1516
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 ...
1
741
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.