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? Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/ 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>"; } Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608134 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. Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608137 Share on other sites More sharing options...
dezkit Posted August 5, 2008 Share Posted August 5, 2008 Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608139 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 ) ) Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608148 Share on other sites More sharing options...
dezkit Posted August 5, 2008 Share Posted August 5, 2008 that's not an error lol Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608150 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. Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608152 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 Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608153 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. Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608154 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. Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608156 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. Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-608549 Share on other sites More sharing options...
rubing Posted August 6, 2008 Author Share Posted August 6, 2008 aye aye captain! Link to comment https://forums.phpfreaks.com/topic/118179-max-uploaded-file-size/#findComment-610239 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.