good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
File::Basename and File::MMagic for File Downloads from Websiteby agent00013 (Pilgrim) |
on Nov 21, 2008 at 00:11 UTC ( [id://725027]=perlquestion: print w/replies, xml ) | Need Help?? |
agent00013 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, I am working on a script that allows users to download files from a website to their computer. Unfortunately, the original file name has been stored using the name sent by the uploading browser and OS. This means file names could be any of the following. Examples: Z:\my_files\docs\some_kind_of_manual.pdf myfile.docx /home/someguy/file.txt My hope is to get the actual file name regardless of which operating system/browser uploaded the file. If I understand correctly, File::Basename assumes the filename is using the same operating system as the server which isn't necessarily true in this situation. My question is: will fileparse() work properly anyway with any of these types of filenames if all I need is the $name of the file? Thanks for your help. (Running Perl 5.8.8 on Debian Etch)
Back to
Seekers of Perl Wisdom
|
|