You are here: Using readfile to bring a "save as" dialog box up « All PHP « IT news, forums, messages
Using readfile to bring a "save as" dialog box up

Posted by vamichael on 05/04/06 01:10

I'm using the following to try and send a file to user, however instead
of getting a "save as" dialog box I'm getting ascii garbage (presumably
the contents of the file) in the browser instead. Can someone please
help? I need the solution to work in both Firefox and IE. Thanks!

<?php
$url="myfile.exe";
header("Content-type: application/octet-stream");
header("Content-Disposition: inline; filename=".basename($url)."");
readfile($url);
?>

 

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

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