Grandioso Posted October 13, 2010 Share Posted October 13, 2010 What's the maximum file size I can upload through a regular form ? If it's server dependant, how do I find out my max ? I tried to handle a 550MB file (on localhost) - I only wanted to show the filename, but it hung up for about 10secs, then returned nothing. Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/ Share on other sites More sharing options...
rwwd Posted October 13, 2010 Share Posted October 13, 2010 ; Maximum allowed size for uploaded files. ; h tt p ://php.net/upload-max-filesize upload_max_filesize = 2M From the php ini file, change as required... Rw Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/#findComment-1121885 Share on other sites More sharing options...
Grandioso Posted October 13, 2010 Author Share Posted October 13, 2010 OK, I found it in "phpinfo()" output. Can I change it on a remote server (maybe with .htaccess) ?? Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/#findComment-1121895 Share on other sites More sharing options...
roopurt18 Posted October 13, 2010 Share Posted October 13, 2010 Sometimes third party hosts will allow you to specify your own php.ini file with custom settings. You could try and set it via .htaccess as you've originally requested with: php_value upload_max_filesize 16M Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/#findComment-1121898 Share on other sites More sharing options...
rwwd Posted October 13, 2010 Share Posted October 13, 2010 you can do it from within your script (but I would ask your host before changing, you don't want to upset them!) using ini_set('upload_max_filesize', 50M) but I would do this as a temp thing, then once the script has executed switch the value back to default. Hope that makes sense... Rw Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/#findComment-1121899 Share on other sites More sharing options...
Grandioso Posted October 13, 2010 Author Share Posted October 13, 2010 I've tried both the methods, but none of them works for me. 1. I have a form, which is handled by a php script. I put "ini_set('upload_max_filesize', 600)" in it (with "600M" (without quotes) it would throw an unexpected string error, with quotes doesn't work either) 2. I created a .htaccess file and put "php_value upload_max_filesize 600M" (w/o qts) in it, and it doesn't work either. Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/#findComment-1121972 Share on other sites More sharing options...
PFMaBiSmAd Posted October 13, 2010 Share Posted October 13, 2010 You cannot set it in a script, because the script is not executed until after the upload has been processed by the server. You can only set php settings in a .htaccess file when php is running as an Apache Module AND the web server has been configured to allow you to alter settings in the .htaccess file. You can only set php settings in a local php.ini when php is running as a CGI application AND the web server has been configured to get php to read a local php.ini. Since you are doing this on your localhost development system, you can set it in your master php.ini. Use a phpinfo(); statement to confirm that the setting was actually changed in case the php.ini that you are changing is not the one that php is using. You must also stop and start your web server to get any change made to the master php.ini to take effect. You must also set post_max_size to the larger value. Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/#findComment-1121975 Share on other sites More sharing options...
Grandioso Posted October 16, 2010 Author Share Posted October 16, 2010 I tried putting the same htaccess file on the server and it doesn't work. I guess it's not possible to change it then, is it ? Quote Link to comment https://forums.phpfreaks.com/topic/215806-max-uploaded-file-size/#findComment-1122691 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.