Downloading
Moderator: General Moderators
Downloading
I am posting different versions of design files and I need for the files to create a pop up save dialog and not open with the default program (usually quicktime grrr). How can I do this?
Re: Downloading
Send download headers:
http://www.ryboe.com/tutorials/php-head ... e-download
http://www.ryboe.com/tutorials/php-head ... e-download
Re: Downloading
What if I'm pulling these files from the database? Here is an example of my code:
Code: Select all
$data = mysql_query("SELECT * FROM postcards ORDER BY id DESC ") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
Echo "<tr><td style='vertical-align: middle; text-align:center;font-size:x-small;'>Open InDesign Files</td><td><a href='upload/postcards/".$info['zip'] . "'><img src='../associates/images/download.png' border='0' width='75'></a><br></td></tr>";
Re: Downloading
Instead of linking directly to the media, you need to link to a download script that will stream it with the forced download headers, as is shown in the link I provided.
Re: Downloading
So should I just replace:
with:
?
Code: Select all
<?PHP
// Define the path to file
$file = 'ryboe_tag_cloud.zip';
?>
Code: Select all
<?PHP
// Define the path to file
$file = $info;
?>
Re: Downloading
Pass the filename as a parameter to the script through the URL and use that parameter instead of the filename in example as you suggested.