0

I have a function creating a zip-file and at the end it downloads this zip-file.

here the problem: the whole function works and it downloads the zip-file and it is usable (not broken or something) but it doesn't go on ... The formular rests there with all the input data and the php stucks ....

if I don't do the zip-download at the end everything is fine (but I don't have the zip file downloaded ...) but if I do the download at the end it stucks ...

here is the download-code:

public function DownloadFile($file){
try{
if(file_exists($file)){
$dateiname = basename($file);
$groesse = filesize($file);
header('Content-Type: application/zip');
header("Content-Disposition: attachment; filename=".$dateiname);
header("Content-Length:".$groesse);
header("Location: ".$file);
ob_clean();
flush();
readfile($file);
}
return TRUE;
}catch(Exception $ex){
echo $ex->getMessage();
}

anyone have an idea?

Sagar V
  • 12,158
  • 7
  • 41
  • 68
Manuel Weitzel
  • 101
  • 1
  • 1
  • 13

0 Answers0