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

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; }


Comment on Re: Uploading and reading file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2014-12-25 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls