Hallo
In meinem Download Script steht:
<a href="download.php?name=2popup.jpg">2popup.jpg</a>
das Download.php sieht so aus:
<?
if(substr($name,-3) != ("jpg"))
{
header("Content-Disposition: attachment; filename=\"$name\"");
readfile($name);
}
else
{
$typ=strrchr($name,".");
switch ($typ)
{
case "jpg":
$typ="image/jpeg";
break;
case "jpeg":
$typ="image/jpeg";
break;
case "jpe":
$typ="image/jpeg";
break;
case "gif":
$typ="image/gif";
break;
}
header("Content-Type: $typ");
header("Content-Disposition: attachment; filename=\"$name\"");
readfile($name);
}
Unter Apache 1.23 gehts !!! unter 2.0.32 gehts nicht.
Im Apache Errorlog steht:
[Sat Mar 09 17:13:03 2002] [error] [client 192.168.1.1] File does not exist: D:/hp/$name, referer: http://192.168.1.1/menue.htm
Weiss jemand Rat ?????
Danke
Bernd
In meinem Download Script steht:
<a href="download.php?name=2popup.jpg">2popup.jpg</a>
das Download.php sieht so aus:
<?
if(substr($name,-3) != ("jpg"))
{
header("Content-Disposition: attachment; filename=\"$name\"");
readfile($name);
}
else
{
$typ=strrchr($name,".");
switch ($typ)
{
case "jpg":
$typ="image/jpeg";
break;
case "jpeg":
$typ="image/jpeg";
break;
case "jpe":
$typ="image/jpeg";
break;
case "gif":
$typ="image/gif";
break;
}
header("Content-Type: $typ");
header("Content-Disposition: attachment; filename=\"$name\"");
readfile($name);
}
Unter Apache 1.23 gehts !!! unter 2.0.32 gehts nicht.
Im Apache Errorlog steht:
[Sat Mar 09 17:13:03 2002] [error] [client 192.168.1.1] File does not exist: D:/hp/$name, referer: http://192.168.1.1/menue.htm
Weiss jemand Rat ?????
Danke
Bernd
Kommentar