473,408 Members | 1,722 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,408 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 11471
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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
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
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...

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.