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.

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.

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);

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

Reply via email to