Re: Perl code Question -

Greg Meckes <[email protected]> Fri, 28 Sep 2007 10:54:06 -0700 (PDT)
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
Couldn't you just say?:

open (STORAGE, ">$dir/$p$file_name")



--- Douglas Brantz <[email protected]> wrote:

> I need to upload a file to the server and I have that working, but I 
> want to add the form# to the front of the file:
> I can do this to the filename stored in Mysql but how do I change the 
> name of the file being uploaded to the server?
> -
> The variable for form number is $p
> 
> I thought I could do this somewhere in this part of the code?
> 
> sub Get_File_Name{
> if ($ENV{HTTP_USER_AGENT}=~/win/i){
> fileparse_set_fstype("MSDOS");
> }
> elsif($ENV{HTTP_USER_AGENT}=~/mac/i){
> fileparse_set_fstype("MacOS");
> }
> my $full_name = shift;
> $full_name = basename($full_name);
> $full_name =~ s!\s!\_!g;
> return($full_name);
> }
> sub Store_File{
> my $file_handle = shift;
> my $file_name = shift;
> my $data;
> #my $mime = uploadInfo($File_handle)->{'Content-Type'};
> open (STORAGE, ">$dir/$file_name")
> or die "Error: $!\n";
> #if($mime !~ /text/){
> binmode ($file_handle);
> binmode (STORAGE);
> #}
> while( read($file_handle, $data, 1024) ){
> print STORAGE $data;
> }
> close STORAGE;
> }
> 
> -- 
> Douglas Brantz
> Computer consultant
> College of Fine & Applied Arts
> Appalachian State University
> Boone, NC 28608
> 
> 828-262-6549 – office
> 828-262-6312 - fax
> 
> 
> -- 
> MySQL Perl Mailing List
> For list archives: http://lists.mysql.com/perl
> To unsubscribe:    http://lists.mysql.com/[email protected]
> 
> 


-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]