Heres a tricky one for you all.
I have som code:
<?
$msgno = $_GET['msg'];
$img = $_GET['img'];
$ServerName = "{mail.blablabla.com/pop3:110}INBOX";
$UserName = "KONTO";
$PassWord = "LÖSEN";
$mbox = imap_open($ServerName, $UserName,$PassWord) or die("död!");
$fileContent = imap_fetchbody($mbox,$msgno,$img);
$fileContent = imap_base64($fileContent);
$fp2 = fopen(($j-1).".jpg","w");
fwrite($fp2,$fileContent);
fclose($fp2);
echo($fileContent);
?>
What this code does is connect to my pop server and "download" a attached file. Then saves it and displays it.
With IIS and PHP the script the image looks like this:

With WindowsXp Apache and PHP the image looks like this:

What I want is to save a correct image to a folder on the server.
This error has been messing my brain for the last couple of hours. And I still can't get it to work. The only problem I can come up with is that Apache doesn't like the way base64 encodes or something. But still it shows a picture. Very odd isn't it.