You are here: problem with file download konqueror-internet explorer « PHP « IT news, forums, messages
problem with file download konqueror-internet explorer

Posted by Cima on 05/17/05 06:35

hi all,
i have the following code in a script whereby i send the filename to be
downloaded. there is something that´s not working properly depending on the
web browser (and probably the Operating system). now im working on
php4,postrgesql,apache2 an mandrake 10 with Konqueror as my web browser.

these are the scenarios:
1) when i call the page that is supposed to allow me to download the file i
selected, with konqueror on the localhost, it works fine and on other
mandrake - konqueror clients too.
2)when i do the same with an internet explorer on winxp the save as dialog
comes up and when i choose the directory, the file that is actually
downloaded is an html with only a few bytes.
3) when i deactivate the last line, readfile("$filename" ), on internet
explorer with winxp, the internet explorer tries to open the file and show
the contents in the browser. on mandrake with konqueror what happens is that
it tries to download the file but says that connection was lost.

any help would be highly appreciated!!

thanx.

if (isset($_POST['select']))
{
$sel=$_POST['select'];

$filename = "$sel";
$size = filesize($filename);
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Length: $size");
readfile("$filename");
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация