show.php

Doesn't correctly identify mime types because .extension (with dot) doesn't 
match
mime.php entries. Either genmime.php needs to change and add dots, or this 
worked
for me in ERW.php:


                $ext = strtolower(strrchr(basename($filename), "."));
becomes:
                $ext = strtolower(substr($filename, strrpos($filename, '.') + 
1));

Haven't tested deviant cases where there are multiple periods (possible?) or no 
extension at all.

---------

Second - when it DOES find a match, it's too late to change the header and add 
the right mime type.

This worked for me:

ERW::connect();
ERW::checkValidUser();

move this block to right after ^^

if (isset($id)) $file = "$_ERW_fileBasePath/".str_replace("_", "/", 
$type)."/".ERW::getOne("file from $type where id=$id");
else list($dummy, $file) = ERW::unpackArray($file);

Header("Content-Type: ".ERW::MIMEtype($file));


which DEFINITELY breaks the logic ... but it works.


---------

Final note - it appears that firefox ignores the Content-Type header, possibly 
because I have the
web developer plugin, but I don't think that's it.

I will be playing with this a bit more and report what I find..

Alfred


_______________________________________________
Erw-devel mailing list
Erw-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/erw-devel

Reply via email to