Toon posts:

[PHP] PHP-Bestanden Downloaden

Pagina: 1
Acties:
  • 33 views sinds 30-01-2008

Verwijderd

Topicstarter
jah de titel he...is dat mogelijk?

  • martinvw
  • Registratie: Februari 2002
  • Laatst online: 14-12-2025
Zoeken

fpassthrough
header(...octetstream)

  • Jorn
  • Registratie: Juni 2001
  • Laatst online: 07-09 08:14
Ja, zoek maar eens ergens op php headers!
Is niet zo moeilijk, en na die header doe je of een header naar de file of een fopen en een fpassthru!
In phpmyadmin gebruiken ze een soortgelijk iets!

* Erkens is een sukkel en ramt in mirc op f5 :+
* XTerm GROOOOOOTE kuis houden op hd's :)


  • martinvw
  • Registratie: Februari 2002
  • Laatst online: 14-12-2025
http://www.php.net/manual/en/function.fpassthru.php
mirko@mcaserta.com
16-Jan-2002 11:34

To display a "Save as..." box which displays the name of the file
you're sending to the user:

<?
$completeFilePath=$fileDir.'/'.$fileName;
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header("Content-type: application/octet-stream\nContent-Disposition:
inline; filename=\"".$fileName."\"\nContent-length:
".(string)(filesize($completeFilePath)));
$fd=fopen($completeFilePath,'r');
fpassthru($fd);
?>

The first two header calls are only needed to make sure the client doesn't
cache the document.

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

Doet iets met Cloud (MS/IBM)

Pagina: 1

Dit topic is gesloten.