pernest Posted January 15, 2010 Share Posted January 15, 2010 Hello I need to allow uploads of files larger than the standard 2MB. I don't think that I have access to the php.ini file on the host I use. Is there any way to adjust this directive from within a script? I know the timeout directive can be adjusted on a script by script basis using set_time_out(), and I was hopeing that someone could point me to something similar for upload_max_filesize. Thanks Paul Link to comment https://forums.phpfreaks.com/topic/188622-changing-upload_max_filesize-for-an-individual-script/ Share on other sites More sharing options...
Felex Posted January 15, 2010 Share Posted January 15, 2010 hi, you arent able to change it at runtime in you script. upload_max_filesize is PHP_INI_PERDIR. So you can change it at .htaccess if you use apache, but AllowOverride needs to be setted at least Options. Link to comment https://forums.phpfreaks.com/topic/188622-changing-upload_max_filesize-for-an-individual-script/#findComment-995812 Share on other sites More sharing options...
pernest Posted January 15, 2010 Author Share Posted January 15, 2010 Thanks for that, the server is apache Unfortunately I'm going to have to be dumb and ask how to write the .htaccess file. I have named a file .htaccess and made sure that it has not extension. The only line I have put in it is upload_max_filesize = 4M this didn't work, I have also tried it with just the line php_value upload_max_filesize = 4000 but this didn't work either. Do I need any headers, or is there something else I'm missing? Link to comment https://forums.phpfreaks.com/topic/188622-changing-upload_max_filesize-for-an-individual-script/#findComment-995841 Share on other sites More sharing options...
Felex Posted January 15, 2010 Share Posted January 15, 2010 you shall use php_value, use php_flag for directives like register_globals which can be set either On or Off. use these commands without = parameter. php_value upload_max_filesize 4M Link to comment https://forums.phpfreaks.com/topic/188622-changing-upload_max_filesize-for-an-individual-script/#findComment-995875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.