Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Uploading and reading file

by Khen1950fx (Canon)
on Nov 22, 2011 at 19:41 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939522]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-06-18 17:35 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (110 votes). Check out past polls.