PerlEx uploading a text file
am 25.12.2007 08:32:45 von findingAri
Hi all,
I have made an PerlEx code that uploads text file and writes it on the
screen (HTML page).
Here is the code:
<%
#!/usr/bin/perl -w
use CGI qw(:standard);
my $cgi = CGI->new();
my $filename = $cgi->param('filename');
print $filename . "
";
my $filehandle = $cgi->upload('filename');
# Wite file to HTML page
while (<$filehandle>)
{
print $_ . '
';
}
%>
Upload text file
# End of PerlEx code
The problem is that this code works some times and some times does not
work (using the exact same code with the same text file).
Any body have an idea why this happens and how to fix it?
Thanks a lot,
Ari
Re: PerlEx uploading a text file
am 25.12.2007 09:20:20 von Gunnar Hjalmarsson
490 wrote:
> I have made an PerlEx code that uploads text file and writes it on the
> screen (HTML page).
> The problem is that this code works some times and some times does not
> work (using the exact same code with the same text file).
As has been said here many times, "does not work" is the worst possible
problem description.
Anyway, the CPAN module CGI::UploadEasy might be useful. It performs a
few checks and displays useful error messages when needed, which
prevents problems when you write upload applications.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Re: PerlEx uploading a text file
am 07.01.2008 13:49:08 von findingAri
On Dec 25 2007, 10:20 am, Gunnar Hjalmarsson
wrote:
> 490 wrote:
> > I have made an PerlEx code that uploads text file and writes it on the
> > screen (HTML page).
>
>
>
> > The problem is that this code works some times and some times does not
> > work (using the exact same code with the same text file).
>
> As has been said here many times, "does not work" is the worst possible
> problem description.
>
> Anyway, the CPAN module CGI::UploadEasy might be useful. It performs a
> few checks and displays useful error messages when needed, which
> prevents problems when you write upload applications.
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl
Hi,
I did the debug mode and get an error "400 Bad request (malformed
multipart POST)", this is after it works a couple of times.
Does anybody know what this error is?
Thanks a lot,
Ari