I deliver a URL to my controller service via prototype ajax. This one is fetching the image and returns
the image base64_encoded.
While observing the response I noticed just an empty result.
I checked the response header and it's "Content-Type:text/html; charset=UTF-8".
Unfortunately I couldn't check the response because it's empty.
Printing the return-part in my controller I got the correct base64-encoded string.
I checked prototype api docs and it says, the response is going to be eval'd
before it shows up in browser.
So what to do? Simply change the response content type? Is there any base64-Type?
I checked the response header and it's "Content-Type:text/html; charset=UTF-8".
Unfortunately I couldn't check the response because it's empty.Is response empty in network sniffer/web inspector? Or in javascript code?
Printing the return-part in my controller I got the correct base64-encoded string.You should check if it is actually written to HTTP response (maybe response is already flushed).
I checked prototype api docs and it says, the response is going to be eval'd
before it shows up in browser.
So what to do? Simply change the response content type? Is there any base64-Type?How are you processing response? Please show your code (here or in jsfiddle.net) or give a link to test site. Ajax.Response#responseText should be filled from XMLHttpRequest#responseText no matter which Content-Type is in response.
Is response empty in network sniffer/web inspector? Or in javascript code?The response is already empty in web inspector.
You should check if it is actually written to HTTP response (maybe response is already flushed).If I return some HTML in addition to my base64 string the HTML arrives in response.