RE: [PHP] help downloading .exe files through php/mysql

From: Date: Fri, 29 Sep 2000 21:26:00 +0000
Subject: RE: [PHP] help downloading .exe files through php/mysql
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-18122@lists.php.net to get a copy of this message
The get.php is the name of the php file you have doing the processing. Just have them change the name in the file->save dialog to file.exe and it will work... ________________________________________ Justin Rodino <justin@goldendome.com> Web Application Developer Golden Dome Media PO Box 1616 Notre Dame, IN 46634 219.631.1116 800.728.7979 ext. 1116 219.631.1001 - fax http://www.goldendome.com/ http://www.wndu.com/ > -----Original Message----- > From: Tyler Longren [mailto:tyler.longren@midiowa.net] > Sent: Friday, September 29, 2000 6:07 PM > To: PHP-General > Subject: [PHP] help downloading .exe files through php/mysql > > > Hi everybody, > > How do I make this pop up a download window. I'm wanting to download > the binary file in the db. Here's my code, the name of this > is get.php: > > <? > > if($id) { > @MYSQL_CONNECT("localhost","root","myfunkypass"); > @mysql_select_db("files"); > $sql = @MYSQL_QUERY("select bin_data,filetype from > binary_data where > id = '$id'"); > $data = @MYSQL_RESULT($sql,0,"bin_data"); > $type = @MYSQL_RESULT($sql,0,"filetype"); > > Header("Content-type: $type"); > echo $data; > > }; > ?> > > It will display images, .jpeg, .jpg, .gif. Any image. But when it > tries to download a .exe file, it pop's up a download window, but it > makes you download get.php. After you download get.php, it > has a bunch > of binary code in it, but it's not the binary of the file. > > Can anybody help me out here? Thanks! > > Regards, > Tyler Longren > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#18122) next »