On Fri, 7 Sep 2001, Kenny Pyatt wrote:

> sub UploadFile
> {
>     my $filePath = shift;
> 
>     # Take the C:\whatever junk or the /something/somthing out of it and 
>       keep just the filename

>     if ($filePath =~ /([^\/\\]+)$/)
>     {
>         my $fileName = $1;
>     }
>     else
>     {
>         my $fileName = $filePath;
>     }
>  
>     # Where to save the file
>     my $writeFile = "$filePath";
> 
>     # Open the file to
>     if (open(FILE,">$writeFile"))

Do you want to use $fileName as your filename for saving?
However, you defined "my $fileName" inside your "if"...
I don't quite get it here.

Maybe change the above lines to (not tested)

========
     my $defaultPath = "/somewhere";
     my $fileName;

     if ($filePath =~ /([^\/\\]+)$/)
     {
         $fileName = $1;
     }
     else
     {
         $fileName = $filePath;
     }
  
     # Where to save the file
     # Open the file to
     if (open(FILE,">$defaultPath/$fileName")) 
=========

-Bird


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to