![]() |
upload video convert it to flv and then move the file to a folder,
$ffmpegpath = "../tool/ffmpeg.exe";
function converttoflv( $in, $out ) { unlink( $out ); $cmd = "$ffmpegpath -v 0 -i $in -ar 11025 $out 2>&1"; $fh = popen( $cmd, "r" ); while( fgets( $fh ) ) { } pclose( $fh ); } function getthumbnail( $in, $out ) { unlink( $out ); $cmd = "$ffmpegpath -i $in -pix_fmt rgb24 -vframes 1 -s 300x200 $out 2>&1"; $fh = popen( $cmd, "r" ); while( fgets( $fh ) ) { } pclose( $fh ); } function flv_import( $upfile, $fname, $title ) { $fname = preg_replace( '/\..*$/', '', basename( $fname ) ); $target = "../video/"; $target = $target . basename( $_FILES['vid']['name']); $flvpath = "$fname.flv"; $thumbpath = "$fname.gif"; converttoflv( $upfile, "videos\\$flvpath" ); getthumbnail( $upfile, "videos\thumbs\\$thumbpath" ); $DateAdded = date("Y-m-d H:i:s"); $sql = "INSERT INTO videos (name, thumb, video_path, eng, fr, ger, date_added) " . "VALUES (\"$title\", \"$thumbpath\", \"$flvpath\", \"$eng\", \"$fr\", \"$ger\", \"$DateAdded\")"; $result = mysql_query($sql) or die("Error: " . mysql_error()); } the problem now is , i get a message: " Warning: unlink(videos\29052009012.flv) [function.unlink]: No such file or directory in C:\xampp\htdocs\toura\internal\video.php on line 16 Warning: unlink(videos humbs\29052009012.gif) [function.unlink]: Invalid argument in C:\xampp\htdocs\toura\internal\video.php on line 25" crazy.gif and the video and thumbnails files are not moved to the folders i'd want, i will appreciate any help and information. blink.gif thanks Ebot Evans |
unlink() deletes a file. if it doesn't exists, then it throws a warning.
check first if the file exists. PHP Code:
|
| All times are GMT. The time now is 03:07 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0