[pmwiki-users] Error on attachments when using $EnableDirectDownload = 0

Helge Larsen hal at post4.tele.dk
Thu Jan 4 16:40:56 CST 2007


Hello Pm

>Strange, when I run ?action=diag it shows up as Content-Type: text/html
>also.
>
>Okay, let's see if we can narrow things down a bit.  Can you put
>the following php script on your server somewhere and run it?
>
><?php
>  header("Content-type: text/plain");
>  echo "<body bgcolor='yellow'> Hello world </body> ";
>?>
>
>If the page comes back yellow, then that means it's a webserver
>or PHP configuration of some sort that is stripping the 
>Content-Type header from the output.  If it comes back as
>the plain text (including the <body bgcolor...> tags), then
>it's something specific to the PmWiki install that is doing
>it.

I have put it here:
	http://www.makoni.dk/hello.php

It comes up with text Hello World on yellow background.

>Here's how it looks on my server:
>    http://www.pmichaud.com/sandbox/hello.php
>
>Here's how it will look if the webserver is changing the
>Content-Type header to text/html:
>    http://www.pmichaud.com/sandbox/hello-1.php

Both of yours does the same (text Hello World on yellow background).

I just found some old php code that generates a gif-image:
<?php
header("Content-type: image/gif");
$im = imagecreate(600,250);
$white = ImageColorAllocate($im, 255,255,255);
$blue = ImageColorAllocate($im, 0,0,255);
$red = ImageColorAllocate($im, 255,0,0);
$black = ImageColorAllocate($im, 0,0,0);
$tekst = "Font 5, Dette er en længere tekst med ii æøåÆØÅ";
imagefill($im,0,0,$white);
imagefilledrectangle($im, 10, 10, 590, 240, $blue);
imagefilledrectangle($im, 100-2, 20-2,
100-2+imagefontwidth(5)*strlen($tekst)+4, 20-2+imagefontheight(5)+4,
$white);
imagestring($im, 5, 100, 20, $tekst, $red);
imageline($im, 20, 230, 580, 230, $black);
imageline($im, 20, 20, 20, 230, $black);
imagegif($im);
?>

I have placed this code here:
	http://www.makoni.dk/testimage.php
and it does return a gif image.

-- 
Regards
Helge Larsen




More information about the pmwiki-users mailing list