Am Mittwoch, 13. April 2005 12.05 schrieb [EMAIL PROTECTED]: > Hello, > > i have a problem after changing form perl 5.6.2 to 5.8. > my upload program for files does not work anymore,
Did it ever? > the > read($fie, $buffer, 2048) is always empty $fie is nowhere in your code. > > > my Programm starts like this > > [code] > #!/usr/bin/perl > > .. bla bla.. > use CGI; > $q = new CGI; > %form = get_form_values(); > > .. bla bla.. > print header(); > .. bla bla.. > > If($form{upload} eq 'do_uplaod') { > Require "upload.pl"; //the program starts file_upload below > ... > > > Sub get_form_values { > > my $q = new CGI(); > my $b = new CGI($ENV{'QUERY_STRING'}); > my @form = $q->Vars(); > my @names = $b->Vars; > my @all; > foreach(@form) { > push(@all, $_); > } > foreach(@names) { > push(@all, $_); > } > return @all; > } > > #short version# > sub file_upload { > > my $field = shift; > use CGI; # Modul fuer CGI-Programme > my $cgi = new CGI; # neues Objekt erstellen > my $file = $cgi->param("$field"); no need to put $field within double quotes $file now contains (I suppose) a filename. > my $maxuploadfilesize = $form{limit} * 1024; > my $pathofpictures = "/www/1/html/normal/"; > my $url = "http://bilder.echtwahr.com/erotik/"; Oh! Again more of this kind of web content... but I have already begun to answer. > my ($width, $height, $size, $format, $name,$mas); > if($file) { > > $uploadfilename = "blabla" > open DAT,'>'. $pathofpictures . $uploadfilename or die 'Error processing > file: ',$!; > my $data; > my $length; > while(read $file,$data,1024) { Read perldoc -f read to find out how to use read. > print DAT $data; > } > close DAT; > > [/code] > > > Now if I make a file upload, with many other fields on perl 5.6.2 he > uploads the image and the field information but since I have perl 5.8 he > only creates me a 0 byte file > > If have tried it with CGI::DISABLE_UPLOAD=0; but nothing works! > > I'm graceful to any help Do you sanitize all user provided input? joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>