advancedfuture Posted January 18, 2008 Share Posted January 18, 2008 First off I don't know if this should be under the apache forum, or here... as I don't know if the issue is my code, or my apache server. I have editted my php.ini file to allow the following: max_execution_time = 300 max_input_time = 300 memory_limit = 300M I also set my upload script to never timeout as shown in my sourcecode below... Yet for some reason it doesn't always except the file... and many times if the file is over 7mb it tries for a minute then executes the else statement and gives me the "Error" message.. Am I going about this the right way? <?php echo '<form action="videoUpload.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <input name="ufile" type="file" id="ufile" size="50" /> <input type="submit" name="submit" value="Upload" /> </form>'; if($_POST['submit']) { set_time_limit(0); $sourcefile = $_FILES['ufile']['tmp_name']; $destfile = md5(uniqid(rand(), true)); $path = "upload/".$destfile; copy($sourcefile, $path); //$newname = md5(uniqid(rand(), true)).".flv"; //$exec = "ffmpeg -i upload\\".$destfile." -ab 56 -ar 22050 -b 500 -r 15 -s 320x240 upload\\".$newname; //exec($exec); } else { echo "Error Uploading Video File"; } //unlink($path); ?> Quote Link to comment https://forums.phpfreaks.com/topic/86702-solved-problem-uploading-larger-files/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 18, 2008 Share Posted January 18, 2008 There are two other size limits, upload_max_filesize and post_max_size, mentioned in the php manual - http://www.php.net/manual/en/features.file-upload.common-pitfalls.php that also affects the size of a file that can be uploaded. Quote Link to comment https://forums.phpfreaks.com/topic/86702-solved-problem-uploading-larger-files/#findComment-443082 Share on other sites More sharing options...
Stooney Posted January 18, 2008 Share Posted January 18, 2008 Also if you're on shared hosting, most hosts won't allow over 20mb for memory_limit. Just something to keep in mind. Quote Link to comment https://forums.phpfreaks.com/topic/86702-solved-problem-uploading-larger-files/#findComment-443091 Share on other sites More sharing options...
advancedfuture Posted January 18, 2008 Author Share Posted January 18, 2008 There are two other size limits, upload_max_filesize and post_max_size, mentioned in the php manual - http://www.php.net/manual/en/features.file-upload.common-pitfalls.php that also affects the size of a file that can be uploaded. BINGO! I had set upload_max_filesize = 300M but I didn't know about post_max_size.... thats where I was failing... since this is a POST form. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/86702-solved-problem-uploading-larger-files/#findComment-443098 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.