Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
|
Not with javascript alone. You will need a server side language to do so.
Javascript can be used to fire the deletion though.
The simpliest, don't put the file directly to download.
Store them outside the reach of the web server.
When a user request it, and if you allow it, use a page as a "proxy".
This page will read the file from the unreachable location, and sent it to the browser (something like "while not end of file, read from source and print to browser" in pseudo code)
Store those access in a db, and simply flag them allowed/disabled for a given url.
You can even put timers in place that way.
Generate an download url that is valid only for 3 minutes, or so.
__________________
Only a biker knows why a dog sticks his head out the window.
|