Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: CGI.pm: upload() succeeds, uploadInfo() fails

by geektron (Curate)
on Jul 21, 2005 at 20:15 UTC ( [id://476991]=note: print w/replies, xml ) Need Help??


in reply to CGI.pm: upload() succeeds, uploadInfo() fails

well:
  1. Which webserver?
  2. Are you sure the file has uploaded? If you don't have the right enc-type on the form, the file doesn't actually get up, even though i've had cases where $q->upload() doesn't throw an error. (hint: check the location of your saved file ... )

Replies are listed 'Best First'.
Re^2: CGI.pm: upload() succeeds, uploadInfo() fails
by Llew_Llaw_Gyffes (Scribe) on Jul 21, 2005 at 20:40 UTC

    Sorry for the omissions. The webserver is Apache 1.3.x, and I've verified that the file is actually getting uploaded.

    My original version of the CGI was straight Perl without using CGI.pm (I prefer not to use CGI.pm, as I feel it unnecessarily obfuscates many simple things), and I was very obviously receiving the file data but just couldn't figure out how to extract it from the multipart/form-data stream without using CGI.pm. I didn't include in my code snippet the file saving code I wrote for the CGI.pm version, because I didn't think it was relevant to the problem, but it does in fact save the file (correctly, and uncorrupted) ... I just can't get any information about the file, either before or after saving it.

    Incidentally, with regard to enc-type, HTMLhelp.com's HTML4 reference page on the input element says, in part:

    The ACCEPT attribute gives a comma-separated list of media types accepted, allowing the browser to filter out inappropriate files. Current browsers generally ignore the ACCEPT attribute.

    I'm using ACCEPT="image/jpeg/image/png,image/gif" anyway, but I'm not relying on it. This is why I want to use uploadInfo() instead of just assuming the user uploaded the correct file type.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-03-29 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found