I'm trying to download files. I recognize the names of the entire file. But when downloading it does it in ZERO BYTES. Let's see if someone sees something irregular. Thank you!
The file is inside the / files / directory on the site.
<?php
Application::Uses('com.web.WebPage');
class download extends TVisualComponent{
public $package='app.admin.ajax';
public $respuesta=array();
public function run(){
$dir_subida = Application::getPath('files');
$file = "..".$dir_subida."/".$_GET['file'];
$file_name=explode("track_",$file);
header("Content-type: octet/stream");
header("Content-disposition: attachment; filename=".$file_name[1].";");
header("Content-Length: ".filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
}