5.
Барыга Обама, не помогает: вот кусок кода отвечающий за скачку
$app->get('/getsong/{vkid}', function(Request $request, $vkid) use($app) {
session_write_close();
$track = Model\Search::find_by_id($vkid);
//header("Content-Length: " . filesize(ROOT . $track->file));
if ( $request->get('dl') ) {
header('Last-Modified:');
header('ETag:');
header('accept-ranges: bytes');
header("Content-Type: audio/mpeg");
$name = str_replace(" ", "_",$track->q);
header("content-disposition: attachment; filename=\"{$name}_[cafesound.ru].mp3\"");
header("content-description: file transfer");
header('content-transfer-encoding: binary');
}
$path = ROOT . $track->file;
return readfile("$path");
//return file_get_contents( ROOT . $track->file );
});
Changed: Владимир (30.08.2013 / 12:50)