473,395 Members | 1,471 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,395 software developers and data experts.

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 11470
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...
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...
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...

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.