Quote:
Originally Posted by willcode4beer
Create a random string, shove it in a DB table with a timestamp, customer id, etc.
Let your URL handler (servlet filter) read the string from the url, check the db (to validate if the time is still good), and serve up the file.
Not sure what server you are using...but, for J2EE, this is about 5-10 minute of work.
|
Exactly - pretty easy work. Totally free and totally simple. I expect the same approach will work no matter what server and languages.
The suggested method - of getting a script to check the timestamp before providing the file - is obviously the best. The second best (ah father ted, the second best priest) would be to put the identifier for this access-permission in a database which is checked at a fixed time each day and incremented - so that the time runs out on all entries. That way you don't get exacty 48 hour cut-off, you get it at the end of the next full day, etc.
My method I thought up for something similar was to get the server to remove the appropriate password from htaccess files on a regular basis - that way I didn't need timestamps so much as little tally-counts... I never actually built it, though, since the product had no requests and I was waiting for one before making the effort.
Why would people spend money on doing something which can be done for free in at least 4 or 5 totally different ways?
|