Jump to content

[SOLVED] delete temp file on server


jmurch

Recommended Posts

I am using the following to generate an xml doc to the users browser:

 

$fp = fopen("document.xml", 'w+');

$str = ($xml_frame->Fields('top_xml').$content->Fields('xml').$content->Fields('xml').$xml_frame->Fields('bottom_xml'));

fwrite($fp, $str);

fclose($fp);

header( 'Location: https://www.website.com/document.xml') ;

 

I would like to delete 'document.xml' after it has been loaded to the user's browser but unlinking the file kills it before it loads and sleep hangs everything. I there a way to detect when it's finished downloading to the user?

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/46290-solved-delete-temp-file-on-server/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.