Rasmus thatnks for your help, this code works.

<?php 
 mysql_connect("localhost","user","pass");
 mysql_select_db("db");
 $query = "SELECT file_path from photos where photos_id=$photos_id";
 $result = mysql_query($query) or die(mysql_error());
 $row = mysql_fetch_row($result);
 $path = $row[0];
 $file_name = basename($path);
header("Content-type: application/octet-stream"); 
header("Content-Disposition: attachment; filename=\"$file_name\""); 
header("Content-Transfer-Encoding: binary"); 
readfile($path);
?> 

Data Driven Design
1506 Tuscaloosa Ave
Holly Hil, FL 32117

http://www.datadrivendesign.com
http://www.rossidesigns.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to