Jump to content

AJAX jpeg headers


simon.huntley

Recommended Posts

I'm using a PHP script to raw output jpeg files in thumbnail generation. This works fine as completely server-side - I call it through an <img> tag, like <img src='picture.php?width=100&path=test.jpg'> but when I do this through an ajax call it outputs the raw binary data. In a sort of blind attempt to fix the problem, I put:
xmlhttp.setRequestHeader("Content-type", "image/jpeg");

in my ajax script to see if that would fix the problem. Anyway, how do you set the right headers after an ajax call? Can't find the answer in any of my books.

Thanks for any help,
Simon.
Link to comment
https://forums.phpfreaks.com/topic/36327-ajax-jpeg-headers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.