Bill et. al.,
This is a little embarrasing. Bill, you helped me with a similar problem
back in December, but I never quite got it. Below is the code you gave me.
But when I browse to a file and submit, I get the error: "Software error:
CGI open of tmpfile: Permission denied".
About 10 lines down is the line 'my $tmpdir = $ENV{TEMP} || "C:/temp";"' Can
the C:/temp" part be the problem? I upload the cgi file to my linux server.
Or do I need to get the people at my server to set permissions somehow?
The code below is at http://biblescramble.com/dns/textAreaLuebkert.cgi.
###########
#!/usr//bin/perl -T
use strict;
use warnings;
use CGI qw/:standard/;
use CGI::Carp qw(carpout fatalsToBrowser);
# place to store files - change me if you like
my $tmpdir = $ENV{TEMP} || "C:/temp";
print header;
print start_html;
if (param ('textAreadomains')) {
print h1 'Hi - got your domains:',
p (
param ('textAreadomains'),
),
}
elsif (param ('fileDomains')) {
my $filename = param ('fileDomains');
my $tmppath = "$tmpdir/$filename";
my $text;
my $size = 0;
while (my $bytes = read $filename, my $buffer, 4096) {
$text .= $buffer;
$size += $bytes;
}
close OUT;
close $filename;
print h1 'Hi - got your file:',
p (
param ('fileDomains'),
),
p ("Content: ", textarea (-name, 'textAreadomains', -rows, "15",
-cols, "75", -default => $text),
),
}
else {
print h1 ('Hi - pick one to input'),
start_form,
p ("Enter domain names, one per line: ", textarea (-name,
'textAreadomains', -rows, "15", -cols, "75"),
),
submit,
end_form,
hr,
start_multipart_form,
p ("Or upload a text file: ",
filefield (-name, 'fileDomains'),
),
submit,
end_multipart_form,
hr;
}
print end_html;
__END__
_________________________________________________________________
Mortgage rates near historic lows. Refinance $200,000 loan for as low as
$771/month*
https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h27f8&disc=y&vers=689&s=4056&p=5117
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs