karldesign Posted April 1, 2008 Share Posted April 1, 2008 Hi all, I want to sell my work online, but i only want to show thumbnails/samples. When a user purchases using PayPal IPN, I want the real image to be available for 24 hours. This file will then delete after this time... Similar to iStockPhoto style of purchasing, so each link is unique... How is this achievable, in a simple way? Quote Link to comment Share on other sites More sharing options...
karldesign Posted April 1, 2008 Author Share Posted April 1, 2008 Also, how do you store these files online without allowing access to them? Quote Link to comment Share on other sites More sharing options...
mkoga Posted April 2, 2008 Share Posted April 2, 2008 One way would be to use a php file to read the images and serve them to the web page. html file: <img src="image.php?file=filename.jpg" /> image.php: if ($validUser) { // display image to browser header('ContentType: image/jpg'); echo file_get_contents($_GET['file']); } Quote Link to comment Share on other sites More sharing options...
karldesign Posted April 2, 2008 Author Share Posted April 2, 2008 It wouldn't be images though. It can be many different kinds of file types... Is there a way of making a temp copy available for download, and keep the official copies secure Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 2, 2008 Share Posted April 2, 2008 store files behind the site root. use the users login status to verify who they are OR on successfull purchase provide them with a code they must enter to get the download. store code in the database and associate with the file in question... use php to create a zip file of the item they have purchased (you can even password protect if you like but you'll have to email that password to the user) and download it using something like http://www.phpit.net/code/force-download/ - this kind of script can access files behind the site root... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.