in reply to Re: Problem uploading file data using CGI
in thread Problem uploading file data using CGI
1. The data as it comes into the web server is Content-Type: application/octet-stream
and that is what is causing the problem because it really needs to be multipart/form-data. CGI.pm is supposed to be able to read application/octet-stream (and, I'm sure, does) but I'm obviously doing something wrong.
2. I think that I've mislead you with regard to the code I'm using to try and extract the data. In both cases it was cut and pasted from the man pages because I'd changed the code in the program to many different things. Here is what I've actually used:-
############ First Attempt $data = $Data->param('POSTDATA'); open(FILE,">/tmp/$Filename"); print FILE $data; close(FILE); ########## Alternative attempt $handle = $Data->upload($Mtfilename); if (defined $handle) { $io_handle = $handle->handle; open(FILE,">/tmp/$Filename"); while ($bytesread = $io_handle->read($buffer,1024)) { print FILE $buffer; } close(FILE); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problem uploading file data using CGI
by tobyink (Canon) on Mar 17, 2013 at 23:36 UTC |