Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm currently retrieving an uploaded file's extension just by splitting the filename split(/\./,$filename). This, however, isn't very efficient as it doesn't take into account that a file might have more than one period in its name. Also, files uploaded from the Windows NT Desktop seem to add some horrible gibberish at the end of the file such as "NTDesktop\etc\etc".
Any ideas on how to retrieve a file's extension?
Thanks,
Ralph
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting a file's extension in an upload form
by sweetblood (Prior) on Jun 17, 2004 at 19:18 UTC | |
by jeffa (Bishop) on Jun 17, 2004 at 20:50 UTC | |
|
Re:Getting a file's extension in an upload form
by pbeckingham (Parson) on Jun 17, 2004 at 20:00 UTC | |
|
Re: Getting a file's extension in an upload form
by Anonymous Monk on Jun 17, 2004 at 20:55 UTC | |
by periapt (Hermit) on Jun 18, 2004 at 13:56 UTC |