I use a html file to browse the HD and then upload it to the web server my $file = $req->param("FILE1"); my $fileName = $file; $fileName =~ s!^.*(\\|\/)!!; $newmain = $fileName;
this contains the filename of the local hd.. ie.. c:/stuff/pic.jpg I am wanting to upload pic.jpg to the server using the following code and save it as pic.jpg on the server.. open (OUTFILE, ">$newmain"); $buffer =<OUTFILE>; print OUTFILE $buffer; close (OUTFILE); but for some reason it only uplaod the first 21 bytes many thanks, Johnno ----- Original Message ----- From: "Justin Hopper" <[EMAIL PROTECTED]> To: "Johnno" <[EMAIL PROTECTED]> Cc: "perl-unix-users mailing list" <[EMAIL PROTECTED]> Sent: Saturday, May 18, 2002 3:46 PM Subject: Re: [Perl-unix-users] file uploads in Perl > Johnno, > > I think you are going to have to give a bit more information than that. > Where are you trying to upload the file to? The code below is a little > confusing. It looks like you opened the file $file for writing, then > tried to read the information into the var $buffer, then tried to output > the contents of $buffer to $file? I'm not sure what would happen here, > but I think you would just end up with an empty file for $file. > > Explain what you are trying to do, and I'd be happy to help you if I > can. Maybe somebody will answer my previous question about perlcc and > using IO::SOCKET =) > > Justin Hopper > [EMAIL PROTECTED] > > > On Fri, 2002-05-17 at 20:38, Johnno wrote: > > how do you upload a file in perl?? > > > > I have var $file which is the file on the local HD.. from there is where a > > get into trouble.. > > > > open (OUTFILE, ">$file"); > > $buffer =<OUTFILE>; > > print OUTFILE $buffer; > > close (OUTFILE); > > > > > > Johnno > > > > > > _______________________________________________ > > Perl-Unix-Users mailing list > > [EMAIL PROTECTED] > > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > > _______________________________________________ > Perl-Unix-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs