PHP Pass File Handle to user so that file downloads & saves to their machine?

You can try this $filetype = mime_content_type($filename); header('Content-type: '. $filetype); header('Content-Disposition: attachment; filename="'. $filename.'"'); UPDATE for your EDIT: Do you have errors disabled, since this sounds like the headers already sent error?

Error_reporting(E_ALL | E_STRICT).

Ah yes, its working for me now. CHeeeers! :P – Abs Feb 12 '09 at 1:04.

You don't have to use fopen() when using readfile(); Just include the filename inside readfile() like this: readfile($_GET'fileUrl'); Although this is very dangerous security-wise as the user could specify any file on your file server. If you only have a few files you want someone to be able to download perhaps you should store them in an array (or database, preferebly) Here's an array example: $files = array('file1. Jpg', 'file2.

Png', 'file3. Pdf'); //assume $_GET'file_id' == 0, 1 or 2 if (file_exists($files$_GET'file_id')) readfile($files$_GET'file_id').

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions