tbare Posted December 30, 2007 Share Posted December 30, 2007 hello.. when i try to upload a file larger than, say 3 MB, it seems as though my script times out... it takes a while, so it looks like it's uploading the entire thing, but when it should say "file uploaded successfully" i get "error: no files uploaded" any ideas? <form enctype="multipart/form-data" action="update_humor_video.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="399999999999" /> <input name="category[]" type="radio" value="random" /> - random<br /> <input name="category[]" type="radio" value="whoseline" /> - whoseline<br /> <input name="category[]" type="radio" value="mac_ads" /> - mac_ads<br /> <input name="category[]" type="radio" value="snl" /> - SNL<br /><br /> Please choose a video file:<br /><input name="uploaded_video" type="file" /><br /> Please choose a thumbnail:<br /><input name="uploaded_thumb" type="file" /><br /> <input type="submit" value="Upload" /> </form> Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted December 30, 2007 Share Posted December 30, 2007 Even though you are setting MAX_FILE_SIZE to something large enough for your file, php has two settings that will affect the maximum file size: upload_max_filesize and post_max_size. Both of these must also be set large enough to accommodate your file. Quote Link to comment Share on other sites More sharing options...
tbare Posted December 30, 2007 Author Share Posted December 30, 2007 so i would need: <input type="hidden" name="MAX_FILE_SIZE" value="399999999999" /> <input type="hidden" name="POST_MAX_SIZE" value="399999999999" /> ? update: just tried w/ a 3.5 MB file and it didn't work Quote Link to comment Share on other sites More sharing options...
tbare Posted December 30, 2007 Author Share Posted December 30, 2007 do i need to define the MAX_FILE_SIZE and POST_MAX_SIZE on the page that moves the files, as well? Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted December 30, 2007 Share Posted December 30, 2007 php.ini.... http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize http://www.php.net/manual/en/ini.core.php#ini.post-max-size Quote Link to comment Share on other sites More sharing options...
tbare Posted December 31, 2007 Author Share Posted December 31, 2007 is there a way to set these parameters using php? i don't have access to the files.... Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 31, 2007 Share Posted December 31, 2007 They can be set in a .htaccess file (when php is running as an Apache module) or in a local php.ini file(when php is running as a CGI wrapper) provided the web host has allowed them to be changed. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted December 31, 2007 Share Posted December 31, 2007 You can also try ini_set, although I'm not entirely sure it will work with both directives. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 31, 2007 Share Posted December 31, 2007 Both of the settings are only settable "PHP_INI_PERDIR" and are not settable in a script. Quote Link to comment Share on other sites More sharing options...
tbare Posted December 31, 2007 Author Share Posted December 31, 2007 ok... so i would have to get a hold of the server admin and have him change the settings since i don't have access? or is there a way around that? i tried http://drupal.org/node/113220 this, but it didn't locate the php.cgi file, so no dice on it... any other ideas? Thanks for all the help, guys! Quote Link to comment 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.