Leser: 3
8 Einträge, 1 Seite |
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/local/bin/perl
use MIME::Lite;
use CGI qw/:standard/;
print "Content-type: text/html\n\n";
# Verzeichnis, in dem die Datei zwischengespeichert wird
my $uploaddir = '/home/b/public_html/upload';
$CGI::POST_MAX=1024 * 1000;
my ($filename) = param('datafile') || "";
my $serverFile = $uploaddir . "/" . (split(/[\\\/]/, param('datafile')))[-1];
print ("Filename: $filename<BR><HR>\n");
if (-e $serverFile){
print ("File $serverFile is already existing\n");
}
else {
print ("Writing to file $serverFile<BR>\n");
my $buffer;
open (FILE,">$serverFile") or die $!;
while (my $bytesread=read($filename,$buffer,1024)) {
print FILE $buffer;
}
close (FILE);
}
chmod (0666, "$serverFile");
$email=param('email');
#special character conversion
$email =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$message = MIME::Lite->new(
From => $email,
To => 'me@my.de',
Subject => 'Beratung',
Type =>'multipart/mixed'
);
$message->attach(Type =>'TEXT',
Data =>$email
);
$message->attach( Type =>'AUTO',
Path =>$serverFile,
Disposition => 'attachment'
);
$message->send(); # UNIX-sendmail
print "Ihre Daten wurden übermittelt. <BR>\n";
# delete message from server
unlink($serverFile);
1
2
3
4
5
6
7
open (FILE,">$serverFile") or die $!;
while (my $bytesread=read($filename,$buffer,1024)) {
print FILE $buffer;
}
close (FILE);
1
2
3
4
5
6
7
8
my $filehandle = upload('datafile');
open (FILE,">$serverFile") or die $!;
binmode FILE;
binmode $filehandle;
while (my $bytesread=read($filehandle,$buffer,1024)) {
print FILE $buffer;
}
close (FILE);
1
2
3
4
my @fieldnames = param(); # hiermit holt man sich alle Feldnamen
foreach(@fieldnames){
print $_, " -> ",param($_),"<br />\n";
}
8 Einträge, 1 Seite |