QT wrote:
Not sure If I have understood your question correctly but surely it would be easier for you to just add the following lines to your .htaccess file and give a direct download link instead of trying to deliver through a php script.Hi,
I want to make a php file for download a jad file. I am using following script to let browser understand that jad file is coming and download it.
addtype application/java-archive jar addtype text/vnd.sun.j2me.app-descriptor jad
if you do deliver through a php script, the phone will follow up with a request for the jar file when it has recieved the jad file, your script needs to be able to handle that as well.
you cannot reset headers once they have been sent. The headers you use seem ok but i would add a no-cache header as well.But I have very interesting problem. If user open browser and write correct addres following script let the download file.
But if the user open browser and write wrong addres and get some error. After write correct address, still getting same error.
I think following script can not reset the previos header and browser still using previous header and bring back an error.
header('Pragma: no-cache');
What should I do, for this problem, any idea
$SRC_FILE = $file; $download_size = filesize($SRC_FILE); $filename = basename($SRC_FILE); header("Content-Type: text/vnd.sun.j2me.app-descriptor"); header("Content-Disposition: attachment; filename=$filename"); header("Accept-Ranges: bytes"); header("Content-Length: $download_size"); @readfile($SRC_FILE);
-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php