DownloadLINKS nur für gereggte!

Also beim besten Willen, es will nicht funktionieren

Meine Ordnerstruktur:

- root
- gish
- uploads

Im Uploads sind nun:

1.
.htaccess mit Inhalt:
PHP:
Redirect /gish/uploads http://www.root.de/gish/uploads/check.php
2.
check.php mit Inhalt:
PHP:
<?
include("../settings.php");
if($_SESSION['login'] == 'ok')
{
header("Content-Disposition: filename=\"".$attachment['filename']."\"\r\n");
header("Content-type: ".$attachment['mimetype']);  
readfile($filepath); 
}
else
{
echo "Nein";
}
?>
Entweder kommt ein Umleitunfslimit oder er Downloadet Dateien im Ordner /uploads obwohl man nicht eingelogt ist! Was da falsch?
 
Hallo,

Du musst natürlich die header() und readfile() daten an dein script anpassen

PHP:
<?
include("../settings.php");
if($_SESSION['login'] == 'ok')
{
$filepath ="Pfad/zur/datei_die_gewonloaded_werden_soll.rar";
header("Content-Disposition: filename=\"DATEINAME\"\r\n");
readfile($filepath);
}
else
{
echo "Nein";
}
?>

MfG Funjoy
 
Zurück