Leser: 23
<input type="file" id="upl" name="file">
1
2
3
4
5
6
7
my $se_input;
my $Input = CGI::escapeHTML( $form->param("file") );
open( IN, "<$Input" ) or die "Konnte Input nicht oeffnen!\n";
while (<IN>) {
chomp($_);
$se_input = $_;
}
open( IN, "<$Input" ) or die "Konnte [$Input] nicht oeffnen: $!\n"
1
2
3
use CGI::Upload;
my $upload = CGI::Upload->new;
my $file_name = $upload->file_name('file');
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use CGI::Upload; use strict; use warnings; my $upload = CGI::Upload->new; my $file_name = $upload->file_name('file'); die $upload->cgi_error . "\n" if $upload->cgi_error; my $se_input; open( $fhin, "<", $file_name ) or die "Konnte Input $file_name nicht oeffnen!\n"; while (my $line = <$fhin>) { chomp($line); $se_input = $line; } ##weiterer Code
Guest gastBekomme ich folgende Fehlermeldung:CGI::Upload->AUTOLOAD : Unsupported object method within module - cgi_error ??
$form->param("file")
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use CGI;
use CGI::Upload;
my $form = new CGI;
my $upload = CGI::Upload->new;
my $file_name = $upload->file_name('file');
die $form->cgi_error . "\n" if $upload->cgi_error;
my $se_input;
open(my $fhin, "<", $file_name ) or die "Konnte Input $file_name nicht oeffnen!\n";
while (my $line = <$fhin>)
{
chomp($line);
$se_input = $line;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<form action=test.pl method=get>
<table border=0 cellpadding=10 cellspacing=10>
.........
<td><textarea type=text rows=10 cols=50 name=sinput></textarea>
<FORM METHOD="POST" ACTION="test.pl" ENCTYPE="multipart/form-data">
<input name=file type=file>
</form>
</td>
</tr>
..........
<td></td>
<td><input type=submit value="SUB"></td>
</tr>
</table>
</form>
</body>
</html>
Guest gastCode: (dl )open(my $fhin, "<", $file_name ) or die "Konnte Input $file_name nicht oeffnen!\n";
open(my $fhin, "<", $file_name ) or die "Konnte Input $file_name nicht oeffnen: $! !\n";
<form action="test.pl" method="get" enctype="multipart/form-data">
1
2
3
4
5
6
7
8
9
10
<html>
<head><title>TEST UPLOAD</title></head>
<body>
<form action=test.pl method="post" entctype="multipart/form-data">
<textarea type="text" rows="10" cols="50" name="sinput"></textarea><br>
<input name="file" type="file"><br>
<input type="submit" value="SUB">
</form>
</body>
</html>