Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-10-2007, 01:49 PM   #1
Paul Ferrie
Scottish and mad fer it!!
 
Paul Ferrie's Avatar
 
Join Date: Jun 2002
Location: uk/scotland/glasgow
Posts: 3,606
Default File upload issue (NOT max upload limit)

hi guys,

I am having a bit of bother with my upload script.

The script runs fine for small files, 5,6,7 meg but as soon as i use a file 30 meg it stops working.

Max upload limit is 50meg
max_execution_time is 2400 // 40 minutes
max_input_time is 2400

I adjusted these settings because my upload speed sucks and a 30 meg file takes the best part of 20 minutes to upload.

I have already spent the best part of today trying to figure this out but i am now at a loss and out of time.
Below is the script and does work for smaller files.

i don't know what else i can check

PHP Code:
$upID         $_GET['upID'];
$upType     $_GET['upType'];
$upDate        date("Y-m-d h:i:s"); 
$movieName    strtolower($_FILES['Filedata']['name']);

$newName    substr($movieName0, -4);
$newMovie    "lesson_movie.flv";
$myLog "../logs/".$upID."_logged.log"
$myHandle fopen($myLog,'a');          
$startTime date("Y-m-d h:i:s"); 
//-------------------------------------------------------------
if($upType == "new"){
    
$logTxt "************************* BEGIN $startTime ADD NEW*************************\n\n";
    
fwrite($myHandle,$logTxt);
    
$xDestination "../media/mentorMedia/temp_".$upID;
    if(!
is_dir($xDestination)){
        
mkdir ($xDestination);
    }
    if(
move_uploaded_file($_FILES['Filedata']['tmp_name'], $xDestination."/".$movieName)){ 
    
//-------------------do conversion-------------------------------------------------//
        
$toexec "D:\ffmpeg\bin\ffmpeg.exe -i D:\wwwroot\media\mentorMedia\\temp_".$upID."\\".$movieName." -r 15 -ar 22050 D:\wwwroot\media\mentorMedia\\temp_".$upID."\\".$newMovie;
        
$doWhat "Convert ".$movieName." to ".$newMovie;
        
$logTxt "Working on job $doWhat\n";
        
fwrite($myHandle,$logTxt);
        
$logTxt "Command to run: $toexec\n\n";
        
fwrite($myHandle,$logTxt);
        
exec("$toexec",$output,$result1);
        if(
$result1 == 0){
            
$logTxt "\n\nSuccessfully ran job $toexec\n\n\r";
            
fwrite($myHandle,$logTxt);
            
$toexec2 "D:\ffmpeg\bin\ffmpeg.exe -i D:\wwwroot\media\mentorMedia\\temp_".$upID."\\".$movieName." -ss 2 -vframes 1 -f mjpeg D:\wwwroot\media\mentorMedia\\temp_".$upID."\\thumb_lesson.jpg";
            
exec("$toexec2",$output2,$result2);
            if(
$result2 == 0){            
                
$logTxt "\n\nSuccessfully ran $toexec2\n\n\r";
                
fwrite($myHandle,$logTxt);
                
resizeImage($xDestination."/thumb_lesson.jpg"320240100$xDestination."/thumb_lesson.jpg"false);    
                
unlink($xDestination."/".$movieName);
            }else{
                 
$logTxt " Second execute failed: ".$toexec2."\n\r";
                
fwrite($myHandle,$logTxt);
             }
        } else {
            
$logTxt " First execute failed: ".$result1."\n\r";
            
fwrite($myHandle,$logTxt);
        }
        
$endTime date("Y-m-d h:i:s"); 
        
$logTxt "************************* END $endTime ADD NEW***************************\n\n\r";
        
fwrite($myHandle,$logTxt);
        
fclose($myHandle);
    }
}else if(
$upType == "replace"){
    
$classID         $_GET['classID'];
    
$lessonID         $_GET['lessonID'];
    
$xDestination     "../media/mentorMedia/classes/".$classID."/lesson_".$lessonID;
    
//
    
$del_1        unlink($xDestination."/lesson_movie.flv");
    
$del_2        unlink($xDestination."/thumb_lesson.jpg");
    if(
move_uploaded_file($_FILES['Filedata']['tmp_name'], $xDestination."/".$movieName)){ 
    
$logTxt "************************* BEGIN $startTime REPLACE *************************\n\n";
    
fwrite($myHandle,$logTxt);
    
//-------------------do conversion-------------------------------------------------//
$toexec "D:\ffmpeg\bin\ffmpeg.exe -i D:\wwwroot\media\mentorMedia\classes\\".$classID."\\lesson_".$lessonID."\\".$movieName." -r 15 -ar 22050 D:\wwwroot\media\mentorMedia\classes\\".$classID."\\lesson_".$lessonID."\\".$newMovie;
        
$doWhat "Convert ".$movieName." to ".$newMovie;
        
$logTxt "Working on job $doWhat\n";
        
fwrite($myHandle,$logTxt);
        
$logTxt "Command to run: $toexec\n\n";
        
fwrite($myHandle,$logTxt);
        
exec("$toexec",$output,$result1);
        if(
$result1 == 0){
            
$logTxt "\n\nSuccessfully ran job $toexec\n\n\r";
            
fwrite($myHandle,$logTxt);
            
$toexec2 "D:\ffmpeg\bin\ffmpeg.exe -i D:\wwwroot\media\mentorMedia\classes\\".$classID."\\lesson_".$lessonID."\\".$movieName." -ss 2 -vframes 1 -f mjpeg D:\wwwroot\media\mentorMedia\classes\\".$classID."\\lesson_".$lessonID."\\thumb_lesson.jpg";
            
exec("$toexec2",$output2,$result2);
            if(
$result2 == 0){            
                
$logTxt "\n\nSuccessfully ran $toexec2\n\n\r";
                
fwrite($myHandle,$logTxt);
                
resizeImage($xDestination."/thumb_lesson.jpg"100100100$xDestination."/thumb_lesson.jpg"false);    
                
unlink($xDestination."/".$movieName);
            }else{
                 
$logTxt " Second execute failed: ".$toexec2."\n\r";
                
fwrite($myHandle,$logTxt);
             }
        } else {
            
//Command failed
            //Add result to logfile
            
$logTxt " First execute failed: ".$result1."\n\r";
            
fwrite($myHandle,$logTxt);
        }
        
$endTime date("Y-m-d h:i:s"); 
        
$logTxt "************************* END $endTime REPLACE ***************************\n\n\r";
        
fwrite($myHandle,$logTxt);
        
fclose($myHandle);
    }

__________________
.:To me AS is like LEGO, Only for the big Kids :.
- InnovativeDesigns - Scotflash - About me
Paul Ferrie is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can't upload file from flash and save to mysql database using php hungboy Server-Side Scripting 6 04-21-2008 10:31 PM
Upload file from local PC to Server Brandon Rohde ActionScript 2.0 3 12-01-2005 03:11 PM
hardcode file to upload with FileReference() Brandon Rohde ActionScript 2.0 1 11-28-2005 11:55 PM
variables sent via getURL() / LoadVars.send() to ASP file, fine in Mozilla not in IE organikh ActionScript 2.0 0 08-03-2005 04:30 PM
allow your user to upload their own .swf file to your web server antonyx ActionScript 2.0 4 04-06-2005 06:21 PM


All times are GMT. The time now is 01:22 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.