/    Sign up×
Community /Pin to ProfileBookmark

Problems with MSIE dowloading from LAMP aplication

Hí! Need some help please! Does anyone know what could be the reason so I can’t download my files from a MSIE 6 browser? When I download from Opera or MoZilla it works properlly, but from the MS browser it doesn’t work. It opens the related application or plugin but after that it shows a message telling that the specified file was not found at C:Documents & Settings...Content.IE5 or something like that. The files are videos, pdf’s, ppt’s, …

I am using a Fedora Core 2 system with Apache 2, MySql 3.23.58 and PHP 4. The field in the BD is BLOB type. The PHP Script is:

<?php

if(isset($id)) {
include_once “ez_sql.php”;

$query = “SELECT file_name, file_format, file_size, file FROM files
WHERE files.id = ‘$id'”;

$result = mysql_query($query) or die(‘Error, query failed’);
list($file_name, $file_format, $file_size, $file) = mysql_fetch_array($result);

header(“Content-length: $file_size”);
header(“Content-type: $file_format”);
header(“Content-Disposition: attachment; filename=$file_name”);
echo $file;
exit;

}

?>

Thanks in advance!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@chazzyJun 13.2006 — hmm the first thing that kind of jumps out is the exit... i could see IE getting that part and saying "ok, bye." when it really doesn't have to - try removing it and seeing how it performs. might not be the whole issue, but could be related.
Copy linkTweet thisAlerts:
@gorkongrooveauthorJun 14.2006 — Thanks chazzy! Deleted "exit;" and added

header("Cache-Control: private");
header("Pragma: public)";


And it works! This links where also useful:

www.php.net/header
http://es2.php.net/manual/en/function.session-cache-limiter.php


In the second one you can find some header configurations that might help those of you who have a problem with MSIE caching or proxys.

Bye!
×

Success!

Help @gorkongroove spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...