Ergebnis 1 bis 4 von 4

Thema: PHP DownloadScript

  1. #1
    TP-Veteran Avatar von Flow09
    Registriert seit
    Jun 2001
    Ort
    Wien
    Beiträge
    1.436

    PHP DownloadScript

    Hallo,

    ich möchte ein Script schreiben das den download von Files startet. Das besondere daran ist das diese Files nicht innerhalb des Webverzeichnisses des Linux-Servers liegen.

    Mit fehlt da jeglicher Ansatz und Google hat bis jetzt auch noch nix brauchbares ausgespuckt!!

    lg
    Flow
    Lesser known Programming Languages #13: SLOBOL
    ... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.

  2. #2
    TP-Veteran Avatar von Flow09
    Registriert seit
    Jun 2001
    Ort
    Wien
    Beiträge
    1.436
    Hier mal was ich bis jetzt habe:

    $_GET['downloadFile'] enthält den absoluten Pfad zu der Datei, z.B. /var/www/tmp/

    Code:
    if(isset($_GET['downloadFile']) && !empty($_GET['downloadFile']))
    {
    		$filename = $_GET['downloadFile'];
            $filesize = @filesize($_GET['downloadFile']);
            
            //Headerinformationen senden
            header("Content-type: application/octet-stream");
            header("Content-Disposition: attachment; filename=$filename");
            if ($filesize) header("Content-Length: $filesize");
            readfile($_GET['downloadFile']);
    }
    Is leider nicht sehr erfolgreich ich bekomm zwar etwas zum Download angeboten aber es ist nicht die Datei dir ich brauche.

    lg
    Flow
    Lesser known Programming Languages #13: SLOBOL
    ... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.

  3. #3
    TP-Special Mod Avatar von steffenk
    Registriert seit
    Feb 2005
    Ort
    Haan / NRW
    Beiträge
    12.869
    also hier im Forum gibts das doch schon alles :
    http://www.traum-projekt.com/forum/5...speichern.html

    Die bessere Variante ist, nur die Id der Datei zu übergeben, der Bezug entweder aus der DB oder aus einem Array.

    TYPO3 · MySQLDumper · dislabs
    ·
    manche Mühlen mahlen schneller ...
    "Ich habe Rücken"
    Horst Schlämmer

  4. #4
    TP-Veteran Avatar von Dome
    Registriert seit
    Feb 2004
    Ort
    Stuttgart
    Beiträge
    1.289
    Das hier könnte zusätzlich noch nützlich sein:
    http://www.php4u.net/index.php?main=...psel&source=20
    Gruß
    Dome
    __________________
    Um mal auf das Renomee-System aufmerksam zu machen: Klick
    TP Battlebay: www.tp-battlebay.de.ki (endlich wieder Online!)

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

     

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51