risposto il codice più ordinato.
siccome non riesco a covertire i file devo eslcudere che sia er colpa del codice. avrei bisogno che qualche esperto mi dicesse che il codice è ok
<?php
ini_set( "max_execution_time", "3600" ); // sets the maximum execution time of this script to 1 hour.
$fileName = $_FILES['miofile']['name']; // get client side file name
if( $fileName ) { // Check File Type
$fileNameParts = explode( ".", $fileName ); // seperate the name from the ext
$fileExtension = end( $fileNameParts ); // part behind last dot
$fileExtension = strtolower( $fileExtension ); // reduce to lower case
if( $fileExtension != "avi" AND $fileExtension != "mpeg" AND $fileExtension != "asf" ) { die( "<br><br><br><br><div align=\"center\" style=\"font-family:verdana,arial;\">Non puoi caricare questo tipo di file.<br> I file ammessi sono <strong>.avi .mpeg .asf</strong></div>" ); } // Check File Size
$fileSize = $_FILES['miofile']['size']; // size of uploaded file
if( $fileSize == 0 ) { die( "Sorry. The upload of $fileName has failed. The file size is 0." ); } else if( $fileSize > 10240000 ) { //10 MB
die( "Sorry. The file $fileName is larger than 10MB. Advice: reduce the file quality and upload again." ); } else { $uploadDir = '/var/www/vhosts/sito/subdomains/member/httpdocs/upload/to_encode/'; // Where the temp file will go
$uploadFile = str_replace( " ", "", $uploadDir . $_FILES['miofile']['name'] ); // Get rid of spaces in the filename
$finalDir = '/var/www/vhosts/sito/subdomains/member/httpdocs/upload/encoded/'; // Where the final file will go
$finalFile = str_replace( " ", "", $finalDir . $fileNameParts[0] . ".flv" ); // Get rid of spaces in the filename
if ( !move_uploaded_file( $_FILES['miofile']['tmp_name'], $finalFile ) )
$encode_cmd = "/usr/local/bin/ffmpeg -i $uploadFile -f flv -acodec mp3 -ab 64 -ac 1 -ar 22050 $finalFile";
exec( $encode_cmd );
unlink( $uploadFile );
chmod( $finalFile, 0644 ); } }
{ header("location: [URL]http://www.google.com[/URL]") ; }
?>