On Thu, 4 May 2000, Troy Sniff wrote:

> I'm trying to grab the original name of the file using CGI.pm to upload.
> 
> Here is what I am doing:
> 
> my @nfn = split (/\\/, $file);
> $NewFileName = pop @nfn;
> 
> where $file is the full path to the file.
> 
> This process will only be done using a graphical browser. My question is,
> will the file coming in through a browser ever use / instead of \?
> 
> If so, my split above will not work in all scenarios.
> 
> on my Windows machine, the filename comes in as:
> 
> d:\directory\myfile.jpg
> 
> Is there a chance that I will ever see it come in as:
> 
> d:/directory/myfile.jpg or /usr/home/myfile.jpg
> 
> or something different from all of those?
> 
> Since I am not familiar with how Mac browsers work or even how a Unix
> graphical browser would work, I don't know if I will see these.
> 
> Who knows, someone out there might have a better way of doing this. If so,
> I'd like to check it out.
>

To cover all the bases ypu might want to consider:
my @info=split/[\\/:]/, $file);

**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****



---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to