Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: CGI Upload: Bad file descriptor

by sacked (Hermit)
on May 24, 2004 at 16:12 UTC ( [id://355959]=note: print w/replies, xml ) Need Help??


in reply to CGI Upload: Bad file descriptor

Is the encoding type for the form that points to this CGI script set to "multipart/form-data" ? If not, CGI's uploading functions will not work as expected. Your form declaration should look something like this:
<form action="some.cgi" method="post" enctype="multipart/form-data">
If you are using CGI.pm to generate the form, then you should use CGI's start_multipart_form function. Here is an example from examples/file_upload.cgi in the CGI.pm distribution:
print start_multipart_form(), "Enter the file to process:", filefield('filename','',45), br, checkbox_group('count',\@types,\@types), p, reset,submit('submit','Process File'), endform;
Aside, I don't see where the variables $name and $ver are set before using them in your loop where you attempt to handle the file uploads:
open (OUTFILE, ">/web/aps/mi/$name/$ver/$_") or die "Cannot open $n +ame: $!";
Where do you initialize these variables?

--sacked

Replies are listed 'Best First'.
Re: Re: CGI Upload: Bad file descriptor
by bkiahg (Pilgrim) on May 24, 2004 at 16:21 UTC
    That was it! Thank you sacked.

    I initialize those variables when I pull the rest of the form. I removed it for brevity.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found