uploader does not accept correct mime type

I use the dhtmlXFileUploader with mode html4 to upload files to my server.
According to your dhtmlxForm/samples/07_uploader/php/dhtmlxform_item_upload.* files the server shall respond with something like

{state: 'true', name: 'filename', size: 1234}

This looks like JSON to me.
But unfortunately the Accept header which is sent to the server does not include “application/json” and when I return it with that Content-Type, then the _onLoad function does not understand it.

The line in dhtmlxform_item_upload.js:

try {eval("var r="+this.fr.contentWindow.document.body.innerHTML);} catch(e){};

does not work. According to the Chrome developer tools in innerHTML the JSON is surrounded by a

 element. It also writes this warning to the console:

To make it work I respond with a “html/text” Content-Type, but this is not correct for JSON.
You should really change that in a future version.

And by the way: eval is evil !!


it works good with “content-type: text/html” for html4 mode
our latest demos already contain corresponding header

we will make more tests and optimize if any, thanks for signal