Beispiel #1
0
 public function sendTheFile(GWF_Download $dl)
 {
     GWF3::setConfig('store_last_url', false);
     $realpath = $dl->getCustomDownloadPath();
     # http header
     $mime = $dl->getVar('dl_mime');
     # currently i am looking for pecl filetype?
     $mime = 'application/octet-stream';
     # not sure about...
     header("Content-Type: {$mime}");
     # about ... mime
     //		$name = $dl->getVar('dl_filename'); # filename is sane. No " is allowed in filename.
     $name = $dl->getCustomDownloadName();
     header("Content-Disposition: attachment; filename=\"{$name}\"");
     # drop attachment?
     $size = filesize($realpath);
     header("Content-Length: {$size}");
     # Print file and die
     echo file_get_contents($realpath);
     die(0);
 }