Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by ksublondie (Friar)
on Nov 25, 2008 at 20:44 UTC ( [id://725943]=note: print w/replies, xml ) Need Help??


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

Sorry...forgot to mention that I tried that too and it doesn't work either. I found some example code that used that, so I decided to give it a whirl, but no luck. My original code snippet has transitioned while trying everything I can find.

If I call $q->tmpFileName(), it's undefined as well. Is upload() supposed to be saving to /tmp? My permissions are drwxrwxrwt on /tmp. Is that what I need? I'm not able to find much detailed info in any doc.

Error log says: readline() on unopened filehandle at /var/www/perl/modules/Lockbox/User.pm line 1833.

  • Comment on Re^2: file upload undefined: Operation now in progress

Replies are listed 'Best First'.
Re^3: file upload undefined: Operation now in progress
by ksublondie (Friar) on Dec 01, 2008 at 23:28 UTC
    Even though, my other web app is still working, I found something that said some of the versions are screwed up & try v3.10 (was using the latest & greatest at v3.42). ...upload() is still undefined...

    What am I overlooking???

Re^3: file upload undefined: Operation now in progress
by ksublondie (Friar) on Dec 17, 2008 at 17:30 UTC
    ...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...

Re^3: file upload undefined: Operation now in progress
by ksublondie (Friar) on Dec 17, 2008 at 19:07 UTC
    OMG!!!

    I finally figured it out. I had an extra unclosed form tag in my HTML that was throwing it off.

Log In?
Username:
Password:

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

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

    No recent polls found