TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-07-2009, 09:18 AM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
ebot is on a distinguished road
Default 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
ebot is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:16 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design