views:

67

answers:

3
+1  A: 

You are not sending the filename to the client, so how should it know which filename to use?

There is a drawback, you can provide the desired filename in the http header, but some browsers ignore that and always suggest the filename based on the last element in URL. For example http://localhost/download.php?help.me would result in the sugested filename help.me in the file download dialogue.

see: http://en.wikipedia.org/wiki/List_of_HTTP_headers

Patrick Cornelissen
i have got the filedownloading without any errors!, i would like to know how it would be possible to view the bandwidth when the cleint downloads the file howmuch stream is sent to the client i really thankful!
Saxtor
Where would you like to see that? I don't understand the question. You don't need to send the whole block at once. Just split it up in chunks and send them one by one and close the connection when you have transfered everything. Then you can report after each chunk what has been uploaded.
Patrick Cornelissen
Hmm, accept an answer and not upvoting it :-/
Patrick Cornelissen
+1  A: 

Everytime you run your while (1) loop you declare openfile function. You can declare function only once. Try to move openfile declaration outside loop.

el.pescado
it works! thanks
Saxtor
i am getting this problem please help!, when i download the file the Length of the file is unspecified, i use wget and it states so including internet download manager
Saxtor
$output = 'HTTP/1.0 200 OK\r\n'; $output .= "Content-type: application/octet-stream\r\n"; $output .= "Content-Length: $filesize\r\n"; $output .= 'Content-Disposition: attachment; filename="'.$file.'"\r\n'; $output .= "Accept-Ranges: bytes\r\n"; $output .= "Cache-Control: private\n\n"; $output .= $send['Output']; $output .= "Pragma: private\n\n";
Saxtor
A: 
Saxtor