rubing Posted August 5, 2008 Share Posted August 5, 2008 I am trying to upload files to my server (shared hosting). The size limit for uploaded files is 2M (default). Well, of course I am super greedy and want to upload HUGE files!!! so, I tried amending the max size permitted as follows: ini_set ('upload_max_filesize','25M'); Yet this has no effect. Any suggestions? Quote Link to comment Share on other sites More sharing options...
dezkit Posted August 5, 2008 Share Posted August 5, 2008 if ($uploaded_size > 350000) { echo "Your file is too large.<br>"; } Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 No, dezkit, he doesn't want to restrict the file size in the script, but he wants to raise his limits. Check out the max post data directive too, I forgot the exact name though. Quote Link to comment Share on other sites More sharing options...
dezkit Posted August 5, 2008 Share Posted August 5, 2008 Quote Link to comment Share on other sites More sharing options...
rubing Posted August 5, 2008 Author Share Posted August 5, 2008 OK, so I changed it as follows: ini_set ('upload_max_filesize','25M'); ini_set('post_max_size','25M'); Yet, this still doesn't work! (only on smaller files) here are the errors i get: Array ( [uploadedfile] => Array ( [name] => 01-Kushee Maanao-Aural Mix-Solace.mp3 [type] => [tmp_name] => [error] => 1 => 0 ) ) Quote Link to comment Share on other sites More sharing options...
dezkit Posted August 5, 2008 Share Posted August 5, 2008 that's not an error lol Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 Yes it is. $_FILES['uploadedfile']['error'] is equal to 1, which refers to an exceeded upload_max_filesize. Quote Link to comment Share on other sites More sharing options...
rubing Posted August 5, 2008 Author Share Posted August 5, 2008 The errors are not sent to std err for file uploading. They are contained in the array. [error]=>1 Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 Indeed. The best you can do is live with your host's PHP settings or get a different host at this point. Quote Link to comment Share on other sites More sharing options...
rubing Posted August 5, 2008 Author Share Posted August 5, 2008 OK. I'm fine with that. As long as I have someone to blame other than PHP. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted August 5, 2008 Share Posted August 5, 2008 First of all, the settings you are trying to change using ini_set() statements cannot be changed in your script (please check the php manual for where any particular setting can be changed.) You can set these 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) AND the host has allowed those particular settings to be changed. Quote Link to comment Share on other sites More sharing options...
rubing Posted August 6, 2008 Author Share Posted August 6, 2008 aye aye captain! 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.