'giorno a tutti,
sto usando meglio tentando di usare questa funzione di andr3a ritrovata in una ricerca su questo forum...
codice:
<?
function forceDownload( &$file ) {
/**
* Function forceDownload:
* download any type of file if it exists and is readable
* -------------------------------------
* @author Andrea Giammarchi
* @date 24/02/2005
* @compatibility PHP >= 4.3.0
*/
if( file_exists( $file ) == true && is_readable( $file ) == true ) {
$filename = &basename( $file );
if( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) {
$parsename = &explode( '.', $filename );
$last = count( $parsename ) - 1;
$filename = &implode( '%2E', array_slice( $parsename, 0, $last ) );
$filename .= '.'.$parsename[$last];
}
$content = '';
$fo = &fopen( $file, 'rb' );
while( !feof( $fo ) ) {
$content .= fgets( $fo );
}
fclose( $fo );
header( 'Content-Type: application/octet-stream' );
header( 'Content-Disposition: attachment; filename='.$filename );
header( 'Content-Length:'.strlen( $content ) );
header( 'Content-Transfer-Encoding: binary' );
echo $content;
exit(0);
}
}
$myFile = $_REQUEST['myFile'];
forceDownload( $myFile );
?>
passo poi la chiamata in questo modo
il download parte sia da Firefox che da IE ma il file scaricato è di un peso minore rispetto all'originale e di conseguenza il video non vine riprodotto andando in errore.
Sapreste darmi una mano ?
Grazie
SK