Page 1 of 1

Downloading

Posted: Thu Jan 21, 2010 10:53 am
by daebat
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

Posted: Thu Jan 21, 2010 11:01 am
by Eran

Re: Downloading

Posted: Thu Jan 21, 2010 1:32 pm
by daebat
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

Posted: Thu Jan 21, 2010 2:47 pm
by Eran
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

Posted: Thu Jan 21, 2010 3:11 pm
by daebat
So should I just replace:

Code: Select all

<?PHP
    // Define the path to file
    $file = 'ryboe_tag_cloud.zip';
?>
 
with:

Code: Select all

<?PHP
    // Define the path to file
    $file = $info;
?>
 
?

Re: Downloading

Posted: Thu Jan 21, 2010 3:45 pm
by Eran
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.