Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

(jeffa) 2Re: Need help with CGI::Upload

by jeffa (Bishop)
on Jul 29, 2003 at 14:26 UTC ( [id://278840]=note: print w/replies, xml ) Need Help??


in reply to Re: Need help with CGI::Upload
in thread Need help with CGI::Upload

Oh dear ... reinventing established wheels ... bad ...

Since you have already loaded CGI.pm ... why not use CGI::upload ... it's a whole lot easier. Here is a short example that you can modify (add error checking, etc.).

#!/usr/bin/perl -T use strict; use HTML::Entities; use CGI qw(:standard); print header, start_multipart_form, filefield('file'), submit('go'), end_form, ; if (param('go')) { my $fh = upload('file'); print hr, pre( map { encode_entities $_ } <$fh>); }

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://278840]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-16 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found