P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This should be a simple one. I am using CGI.pm to upload files to the server and all works for the JPGs. However, for some reason, the equivalent code for PDFs fails. My apache error log gives a "Malformed multipart POST: data truncated" and I have seen this cited elsewhere. Again, the same thing works for the image files in parallel code. The form is simple:
(xxxxx is just hiding the actual script name.) For jpgs, I have this, and it works:
It is processed with:
The only real difference for the JPG uploader for that is that there is a size restriction placed on the file with:
I do not have that at all for the PDFs. Is "application/pdf" incorrect or do I have to make some other accommodation? This has to be a SMH simple thing, but eludes me. Thanks, in advance, for any assistance. One thing that did occur to me is the possibility of a buffer limitation in the post. I have bumped up against that for $ENV{'CONTENT_LENGTH'} before. UPDATE - SOLVED I'll keep this here with the solution in case someone else faces the same thing. sysread(STDIN, $inputdata, $ENV{'CONTENT_LENGTH'}); Don't need to do this, unlike in ordinary form post processing. Leave that out and it works like a charm. In reply to File Upload Frustration by jcinsd
|
|