Bruce32903 has asked for the wisdom of the Perl Monks concerning the following question:
My code puts a working file upload box on the browser and seems to work properly. After the browser returns I have the file name in param("uploadedfile") as expected. My problem is I don't know how to access the file.#!/usr/bin/perl -w # code_fragment.pl use strict; use CGI qw(:standard escapeHTML); # ------ start posting to browser ------ print header (), start_html( (-head => [ Link ({ -rel => 'icon', -type => 'image/png', -href => '/perl_img/my_icon_01.ico'}) +, ] ), (-title => "My File Upload Utility", -bgcolor => "whit +e") ); print ('<IMG SRC="http://' . $server_ip_addr . '/image004.jpg" /><br / +>' . "\n"); print ('<h2>UPLOAD A NEW FILE</h2>' . "\n"); # ------ post form to browser ------ print start_multipart_form(-action => url()), '<input type="hidden" name="MAX_FILE_SIZE" value="5000" />', "\n", 'Select file to upload: ', "\n", '<input name="uploadedfile" type="file" size="40"/><br />', "\n", "<br /><br />\n", "<br /><br />\n", '<input type="submit" name="choice" value="Upload File" /> &nb +sp; ', "\n", '<input type="submit" name="choice" value="Abort Upload" />', "\n", end_form(); print end_html(); exit(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File upload under Apache2
by Anonymous Monk on Aug 16, 2010 at 03:27 UTC | |
by Bruce32903 (Scribe) on Aug 16, 2010 at 04:20 UTC | |
by Anonymous Monk on Aug 16, 2010 at 04:36 UTC | |
by tospo (Hermit) on Aug 16, 2010 at 09:11 UTC | |
by Anonymous Monk on Aug 16, 2010 at 09:31 UTC | |
| |
|
Re: File upload under Apache2
by CountZero (Bishop) on Aug 16, 2010 at 08:53 UTC | |
by Anonymous Monk on Aug 16, 2010 at 09:34 UTC | |
by CountZero (Bishop) on Aug 16, 2010 at 10:24 UTC | |
by wfsp (Abbot) on Aug 17, 2010 at 07:43 UTC | |
|
Re: File upload under Apache2
by Bruce32903 (Scribe) on Aug 16, 2010 at 15:05 UTC |