phpbar.de logo

Mailinglisten-Archive

Re[4]: [php] security Download -->test3

Re[4]: [php] security Download -->test3

Andreas Bender php_(at)_phpcenter.de
Fri, 17 Aug 2001 10:54:02 +0200


On Fri, 17 Aug 2001 09:30:55 +0200, Alexander Hessenkamp wrote:

>header("Content-Type:application/qctet-stream");
>header( "Content-Disposition: inline; filename=3D" . $Filename );
>header("Content-Length: ".$len);
>readfile($FilePath.$Filename); ?>

Hast Du da nicht ein paar G=E4nsef=FC=DFchen vergessen?
Habe vor Monaten mal folgendes geschrieben:

$query =3D "SELECT url,datei,dateityp FROM dateiurl WHERE id=3D$id;";
  if ($result){
    $result =3D mysql_db_query($database,$query);
    $row =3D mysql_fetch_array($result);
    header("content-disposition: attachment; filename=3D$row[datei]");
    header("content-length: $row[groesse]");
    header("content-type: $row[dateityp]");
    header("pragma: no-cache");
    header("expires: 0");
    readfile("$row[url]");
    
    if ($readfile){
     	header("Location: $HTTP_REFERER");
	exit;
    }
  }
  else{
    [Fehlermeldung]
  }



Gru=DF
Andreas Bender

 *** Member of LDK-Net e.V. #1 *** www.ldknet.org ***




php::bar PHP Wiki   -   Listenarchive