Security for a Small Stock Photo Company
ExTex asks: "I am a commercial photographer, and I also run a very small stock photography company. Most of the sales that I make are to existing clients or from referrals. Currently, when I make a sale I upload a ZIP file of the image and create a unique web page for the customer to download. I pull the page shortly after the client has confirmed receipt. This is easy, when I'm in the office, but can be a challenge if I'm out in the field on a shoot. At some point I'd like to be able to have 400 of my best images already pre-zipped and loaded to my web host for quick download. I'm wondering how best to secure the images to prevent unauthorized download but also make it relatively easy for the typical un-savvy client."
Are you looking for an off the shelf solution for this?
.NET, what have you).
Because this kind of thing would be pretty easy with any scripting language (PHP, Perl, ColdFusion,
Just issue a 'ticket' (token in URL) to the client when they purchase. That token can be stored on the site to allow access for a certain amount of time. You could also throttle it so that too many attempts on the same ticket trigger a lockout until you've had a chance to review it.
Otherwise, send them the URL (with the token) and give them 24 (or whatever) hours to download the file. (If they try to download more than X times before the ticket expires - lock it out until you've made sure it isn't that they've given the ticket out to 10,000 of their friends).
- Place the zipfiles into a directory readable by the webserver but not accessable over HTTP. Call it something like
/webroot/private
- Create a second directory, writable by your shopping cart script and HTTP-accessable. Call it something like
/webroot/orders
- When a customer places and order, have the script create a symbolic link from the private directory to an order-specific filename in the public directory (an MD5 sum of e.g. the time + process id might make an appropriate filename)
- Provide a link to the symlinked file in the customer's receipt
For example:In the script: /webroot/private/CONTENT.zip /wehroot/orders/RANDOM_FILENAME.zip
ln -s
In the receipt:i p">Click here to download</a>
<a href="http://example.com/orders/RANDOM_FILENAME.z
(Thank you slashcode for clobbering that code - get rid of the space in 'zip' and the '[example.com]' string, above)
This isn't foolproof since customers can still pass the URL on to others. If they do though, you'll know who did it based on the order-specific filename.
Accept Eris as your Fnord and personally sate her