Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Uploading and reading file

by Khen1950fx (Canon)
on Nov 22, 2011 at 19:41 UTC ( [id://939522]=note: print w/replies, xml ) Need Help??


in reply to Uploading and reading file

Here's what I found. Make sure that you run it with -T on the cmdline. I left out the csv section to concentrate on CGI.
#!/usr/bin/perl -lT use strict; use Fcntl qw/:DEFAULT :flock/; use CGI::Carp qw/fatalsToBrowser/; use CGI qw/:standard -private_tempfiles/; $CGI::POST_MAX = 1024 * 1024 * 50; $CGI::DISABLE_UPLOADS = 0; use constant UPLOAD_DIR => '/tmp'; use constant BUFFER_SIZE => 16384; use constant MAX_DIR_SIZE => 1024 * 1024 * 100; use constant MAX_OPEN_TRIES => 100; my $q = new CGI; print $q->header( "text/html", -expires => "-1s" ), $q->start_html( -title => "Wordcloud Generator", -bgcolor => "#ffffff", -head => $q->meta( { -http_equiv => 'Pragma', -content => 'no-cache' } ) ), $q->h2("Wordcloud Generator"), $q->hr, $q->p( "Processed file:", my $file ), $q->end_html; my $in = $q->upload('file'); $in = param('upload'); if (not $in && cgi_error()) { print $q->header(-status => cgi_error()); exit 0; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-04-23 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found