I got the following function in restler
/**
* get updateFiles by name
*
* one could get the last update file
*
* @status 201
* @return file
*/
function getupdateFile($filename) {
$file = 'Plakat.jpg';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
else {
return "<h1>Content error</h1><p>The file does not exist!(".dirname(__FILE__).'/'.($file).")</p>";
}
}
The problem is that the file is there permissions are correct but no file download is forced. Where is the failure? It always return "The file does not exist but it does. I searched for different problems with force download an php but this seems to be a problem with restler?
Thx Ingo