[libapreq] unknown content-type: `application/octet-stream"

[libapreq] unknown content-type: `application/octet-stream"

am 12.08.2011 04:47:14 von silent

hi, list

I'm using a javascript ajax file uploader, but get this error with mod_perl1.

the js code is like:

var xhr = new XMLHttpRequest();

xhr.open("POST", queryString, true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
xhr.setRequestHeader("Content-Type", "application/octet-stream");
xhr.send(file);

Re: [libapreq] unknown content-type: `application/octet-stream"

am 12.08.2011 10:22:54 von Salvador Ortiz Garcia

On 08/11/2011 09:47 PM, silent wrote:
> hi, list
>
> I'm using a javascript ajax file uploader, but get this error with mod_perl1.
>
> the js code is like:
>
> var xhr = new XMLHttpRequest();
>
> xhr.open("POST", queryString, true);
> xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
> xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
> xhr.setRequestHeader("Content-Type", "application/octet-stream");
> xhr.send(file);
libapreq can only parse 'application/x-www-form-urlencoded' or
'multipart/form-data'.

So if you want use Apache::Request (libapreq) and handle file uploads,
you should use a Content-Type of 'multipart/form-data'.

Or write your own request parser.

Regards.

Salvador Ortiz.