in reply to filenames from filehandles
I agree with chromatic -- don't trust the client. The ability to upload .zip files named .jpg has been used to upload warez various places. In the general case, though...
if ($^O eq 'linux' and -d /proc) { $procpath=fileno($fh); $filename=readlink($procpath); $filename=undef unless -e $filename; }
note that this is linux-specific, though there is a similar proc on many unixes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: filenames from filehandles
by ikegami (Patriarch) on Feb 06, 2009 at 17:29 UTC |