kartikay malhotra schrieb:
Dear All,
I have a HTTP server + MySQL database. Everytime a file is requested for
download, my PHP script loads the content from the database into a
temporary
file (on the server). I then pass a URL to the client, with a link to this
file. The client can thus download the file at any time.
However, I can foresee many problems with this approach. One is, when to
delete the temporary file? Also with more than one client, this approach
would have to be refined. Security is also an issue: One user may read
another's files.
Can anyone kindly give me an alternative approach?
I reiterate, I cannot supply static URLs as the downloadable file is
generated on-demand.
Thanks & Regards
KM
Code a page that passes the appropriate headers for the file to the user
and passthrough the file to the user.
That way no file is been generated and therefore nothing can be stolen.
I would do it like that
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php