in reply to How to find a file using perl

Do you realize that the problem as you have described it has a very simple solution: just put the files in a directory and have your web server serve them directly. The server will list the files automatically when the url corresponding to the directory is accessed.

Replies are listed 'Best First'.
Re^2: How to find a file using perl
by psini (Deacon) on Jun 28, 2008 at 13:24 UTC

    There could be security issues in the method you proposed.

    I had a similar problem having to serve data files to the client in an authenticated session. If the files are free to download, an unauthorized user could get them guessing the filenames (and randomize filenames was not an option, because "regular" users wanted meaningful names).

    In the end I used a Perl cgi script that serves the file provided that you ask it with name and md5 hash of its content. So in the authenticated pages I have a link containing both of them, but no one can guess the hash based on a (guessed) filename.

    Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."