in reply to Uploading Files with CGI.pm results in 0 byte files
Here's a standalone version of the provided code that dumps the file to the browser, along with the temp file name.
Could you provide some details about your environment?#!/usr/bin/perl use strict; use warnings; use CGI; my $output = ''; my $query = CGI->new(); my $filename = $query->param("uploadfile_0"); my $upload = $query->upload("uploadfile_0"); $output .= "Temp file: " . $query->tmpFileName($filename) . "\n"; if (!$upload) { $output .= "<p>CGI.pm failed to upload the file.</p>"; } else { $output .= "----- Contents: ------\n"; while (<$upload>) { $output .= $_; } } print "Content-type: text/plain\n\n"; print $output;
OpenBSD 3.5 Apache 1.3.34 perl 5.8.2 CGI 3.20
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Uploading Files with CGI.pm results in 0 byte files
by Anonymous Monk on Nov 19, 2006 at 21:21 UTC | |
by friedo (Prior) on Nov 19, 2006 at 21:38 UTC | |
by trwww (Priest) on Nov 21, 2006 at 01:01 UTC | |
|
Re^2: Uploading Files with CGI.pm results in 0 byte files
by Anonymous Monk on Nov 19, 2006 at 20:56 UTC |