simon.huntley Posted January 30, 2007 Share Posted January 30, 2007 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. Quote Link to comment Share on other sites More sharing options...
satya61229 Posted February 1, 2007 Share Posted February 1, 2007 I think you did the right thing.Just put that line in conditional statement and pass a condition when calling ajax function from html element. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.