Re: Re: A general question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You have to trick the browser into thinking that the jpg file is something
other then a jpg.  This is sketchy and does not always work.

Something like this maybe
             $len = filesize($file_path);
             header("Content-Type: application/force-download");
             header("Content-Type: application/octet-stream");
             header("Content-Disposition: attachment; filename=$file");
             header("Content-Title: $file_path");
             header("Content-Length: $len");
             readfile($file_path);

            $fh=fopen($file_path,'rt');
             @fclose($fh);

HTH

<?php
/*

Stephen Johnson c | eh
The Lone Coder

http://www.thelonecoder.com
stephen@xxxxxxxxxxxxxxxx

562.924.4454 (office)
562.924.4075 (fax) 

continuing the struggle against bad code

*/ 
?>

> From: zzapper <david@xxxxxxxxxx>
> Date: Mon, 07 Mar 2005 17:19:30 +0000
> To: php-general@xxxxxxxxxxxxx
> Subject:  Re: A general question
> 
> 
>> How can I click on a link which is linked to a JPG file and instead of
>> displaying it in the browser save it somewhere on the local machine or
>> open in a different software ?
>> 
>> Please help very urgent
>> 
>> Thanks
>> vaibhav

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux