I used PHP and Apache on Windows 7 without problems. I had a photo database for my own needs. But I changed my notebook to W8 and face the problem after.With the transition to MS Windows 8 and IIS got a problem displaying photos. It displayed only photo frame.
I tried it with different browsers and different PC with access to the site without any result. To test the problem, I wrote a simple code, which is also not working like in Apache. echo '<IMG src="test.php" WIDTH="768" HEIGHT="512" BORDER="0" ALT="bee"> </IMG>
<BR/>'; and: $fhandle = @fopen("photo1.jpg","r"); $file_size = @filesize("photo1.jpg"); $test = @file_get_contents("photo1.jpg"); header("Content-type: image/jpeg"); header("Content-length: {$file_size}"); header("Content-Disposition: attachment; filename=photo1.jpg");
header("Content-Description: PHP Generated Data"); echo $test;
Also, I found that the saved image has sat down to 3 additional bytes and can not be displayed, for example, using standard windows photo editor. Perhaps this is due to the HTTP Headers? Or are there other reasons?
AIV2104
2 Posts
JPG and e.t.c are not displayed
Jan 20, 2013 08:43 AM|LINK
AIV2104
2 Posts
Re: JPG and e.t.c are not displayed
Jan 20, 2013 04:11 PM|LINK