Jump to content

Antonio1471

New Members
  • Posts

    7
  • Joined

  • Last visited

Antonio1471's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi kicken, I followed your advice and inserted a http-equiv meta on the download_and_delete.php page with 1 second delay By doing this I have the file data and a thank you printed. Thank you very much for your advice. Bye Antonio
  2. I tried putting the function in a new php page and calling it with : header("Location: ./anotherFile.php"); and first print THANK YOU. It still won't print it. If I flush it prints it, but it doesn't call up the new downoload php page.
  3. Thank you for your reply. I tried printing before calling the download function but it doesn't work. You recommend that I put the function in a new php page, thank the user, and then a redirect to the new php page that effectuates the download and deletion of the file, correct? But how can I pass 2 variables to the download page? I need to indicate the name of the file to download and delete. Now I call the function like this : Download_Delete_File($filename,$destPos); Thanks again
  4. function Download_Delete_File($filename,$destPos) { ignore_user_abort (true); set_time_limit ( 0 ); $file_path = './'.$filename; $file_type = 'text/csv'; $file_name = $filename; //header ( 'Cache-Control: max-age=31536000' ); //header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); header ( 'Content-Length: ' . filesize ( $file_path ) ); //header ( 'Content-Disposition: filename="' . $file_name . '"' ); header ( 'Content-Type: ' . $file_type . '; name="' . $file_name . '"' ); header('Content-disposition: attachment;filename="' . $file_name . '"'); ob_clean(); flush(); readfile ( $file_name ); unlink ( $destPos ); unlink ( $file_name ); exit (); } Hi all, I have used the code above to do a download of a file generated by PHP code on the client and it works. Now I have the problem of making the browser write more echoes to indicate that the file is in the download folder and some other information. I have tried removing the exit command to make the PHP code continue but it does not work. I also tried ob_start, $continue=ob_get_clean, but I can't see the rest of the code on the browser. It just stops at the start page without continuing. Do you have a suggestion to continue the php script so that it shows me the rest of the print functionthat is called after the download? I also tried calling the print function first, but to no avail. Do you have any ideas that can help me? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.