Emir Posted December 4, 2006 Share Posted December 4, 2006 Hello,Basically, I am wanting something like this to happen: A php script copies a file from a directory that is unreadable by the public to a directory is readable. The person then downloads this file and somehow the file is deleted afterwards. Is there a way to detect when a person is done downloading a file?I am not sure if this is a good or even feasible way of accomplishing what I want. If you know how to do this, of some tutorials, or any other alternative method, please let me know. I simply am wanting to make a site where someone purchases a "file" and the file is delivered to them while keeping the files unreadable at their source.Any help would be greatly appreciated!Thank you,Emir Link to comment https://forums.phpfreaks.com/topic/29431-remove-file-once-download-is-completed/ Share on other sites More sharing options...
Caesar Posted December 4, 2006 Share Posted December 4, 2006 I will not provide you with a script...however, I will point you in the right direction:[code]<?php header("Cache-control: private"); header("Content-type: application/force-download"); header("Content-transfer-encoding: binary\n"); header("Content-disposition: attachment; filename=\"$filename\""); readfile($directory.'/'.$filename); unlink($directory.'/'.$filename);?>[/code]You need to modify this and implement it into your code. But please do not come on here asking for scripts. Link to comment https://forums.phpfreaks.com/topic/29431-remove-file-once-download-is-completed/#findComment-135059 Share on other sites More sharing options...
Caesar Posted December 4, 2006 Share Posted December 4, 2006 If you're going to be selling something or dealing with ecommerce, I suggest not coding it yourself if you lack the experience. Far too much liablity and problems.http://www.turnkeywebtools.com/products.php?p=ss-shopping-cart-softwareThat software (Coded in PHP) supports digital downloads already. And they provide support for it. Link to comment https://forums.phpfreaks.com/topic/29431-remove-file-once-download-is-completed/#findComment-135064 Share on other sites More sharing options...
Emir Posted December 4, 2006 Author Share Posted December 4, 2006 I apologize for coming across as wanting a script to solve my problems. I only desired to be "pointed in the the right direction." Anyway, Caesar, thank you for your time, what you have given me should help me greatly! Link to comment https://forums.phpfreaks.com/topic/29431-remove-file-once-download-is-completed/#findComment-135072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.