Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date ][Interchange by thread ]

Re: [ic] s/Reg Exps on file paths/headaches/g ;



On Tue, Mar 13, 2001 at 09:44:41AM -0500, office.standardprinting.net wrote:
> I'm working on an upload page, and found the docs on using [value-extended],
> etc.  So far, so good.
> 
> But the <input type="file" . . . > tag returns a full path from Win clients,
> e.g.: F:\folder\file.jpg (Macs dutifully return only the filename, not the
> whole path :)
> 
> $filename =~ s|.*[\\]{1}|| ;
> 
All you really need here is:

$filename =~ s|.*\\||;

to get rid of everything up to and including the last backslash.  You might
want to include forward slashes as well, as most unix browsers also return
the full path.  This should do the trick:

$filename =~ s|.*[\\/]||;

-- 
Jason S Kohles
jason@jasonkohles.com

_______________________________________________
Interchange-users mailing list
Interchange-users@lists.akopia.com
http://lists.akopia.com/mailman/listinfo/interchange-users


Search for: Match: Format: Sort by: