Que es lo que quieres hacer man, no entiendo muy bien!
tengo un sistema de descargas musical , la cuestion es que actualmente se queda "waiting" osea esperando mi servidor
como he intentado hacerlo de milmaneras y no encuentro solucion a el "porque" cojones se queda esperando mi servidor,(incluido hablar con el provehedor de hosting)
he pensado en una solucion que en vez de descargar el archivo directamente que parece ser el problema, que lo abra en otra ventana y listo
ahora mismo lo tengo haciendo una llamada desde "download.php" con el siguiente codigo:
<?php
$file = htmlspecialchars($_GET['the_file']);
$parse_url = parse_url($file) ;
$path_info = pathinfo($parse_url['path']) ;
//print_r ($path_info);
$file_basename = $path_info['basename'] ;
$file_extension = $path_info['extension'] ;
if ($file_extension=='mp3' || $file_extension=='ogg') {
// Maximum size of chunks (in bytes).
$maxRead = 2 * 100024 * 100024; // 1MB
// Give a nice name to your download.
$fileName = $file_basename;
// Open a file in read mode.
$fh = fopen($file, 'r');
// These headers will force download on browser,
// and set the custom file name for the download, respectively.
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"');
// Run this until we have read the whole file.
// feof (eof means "end of file") returns `true` when the handler
// has reached the end of file.
while (!feof($fh)) {
// Read and output the next chunk.
echo fread($fh, $maxRead);
// Flush the output buffer to free memory.
ob_flush();
}
// Exit to make sure not to output anything else.
exit;
} else {
echo "<script>window.close();</script>";
//die();
}
?>
- - - Actualizado - - -
¿Lo haz probado con el method post? 🙂
Sería bueno que nos brindarás más info sobre lo que quieres hacer...
probado pero nada, abre ventana para cerrarla de inmediato sin realizar ninguna accion.
bueno estoy dando por supuesto ahora que ando probando que el problema viene por el https
si pruebo lo mismo desde unadescarga sin https si que lo realiza
alguna idea de como corregir esto en php?