Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: file upload undefined: Operation now in progress

by ksublondie (Friar)
on Dec 17, 2008 at 17:30 UTC ( [id://730999]=note: print w/replies, xml ) Need Help??


in reply to Re^2: file upload undefined: Operation now in progress
in thread file upload undefined: Operation now in progress

...still working on this...

I've installed CGI::FileUpload to see where that gets me. Here's my current code:

sub customerupload{ my $self = shift; my $q = $self->query; my @data; my $error = ""; my $filename = $q->param('uploadfile'); my $file; if($filename) { my $filehandle = new CGI::FileUpload(); $file = $filehandle->upload('query'=>$q); my $data; while(<$file>) { $data .= $_; } if($data) { $error = 'Successfull upload'; } else { $error .= $CGI::VERSION."Nothing read<br>$file +name<br>$file<br>"."<br>$!<br>"; } } else{$error .= $CGI::VERSION."file not uploaded <br>$filename< +br>$file<br>"."<br>$!<br>";} return $self->template({ file => 'customers.html', vars => {er +ror => $error, }}); }
However, it crashes at the line in CGI::FileUpload.pm that uses the CGI::upload method (back to square 1):
my $fhin=CGI::upload('uploadfile')||CORE::die "cannot convert [$filena +me] into filehandle: $!";
The error message actually returns the name of my file i'm trying to upload. The CGI::FileUpload is creating the tmp files in /tmp/CGI-FileUpload dir: the key file (0 K), the key.part file (0 K), and the key.properties file (creates the file_orig, from_id, from_ipaddr, key, pid, and upload_status fields).

don't know if I'm getting anywhere or not...

Log In?
Username:
Password:

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

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

    No recent polls found