views:

443

answers:

3

I'm not sure if this is possible, but here's what I would like to do.

I have a .php script that uploads and then manipulates the file. I only want that particular .php script to be allowed to upload large files, the php.ini settings should apply for all others.

Can I edit the .htaccess file to affect only the one .php script?

In pseudo-code:
if (myPhpScript.php) {
   php_value upload_max_filesize 16M
}


Thanks!

A: 

I am not sure but you could just use the function ini_set() within the php file you want to have the ini value changed. See: http://php.net/ini%5Fset

markmywords
Nope, afraid not, for this setting it has to be done in the .htaccess file or the php.ini file
CJ
And again I learned something new. +1
markmywords
A: 

http://roshanbh.com.np/2008/01/uploading-larger-files-in-php.html

CodeJoust
I only want to allow large file uploads for a specific .php file not all of them. I don't see anything on this site for this, only instructions on how to change settings generically via the .htaccess file or am I missing something?
CJ
+4  A: 

You should be able to use the Files directive in .htaccess:

<Files myPhpScript.php>
    php_value upload_max_filesize 16M 
</Files>
jensgram
Yey! Many thanks, that works.
CJ
You're welcome :)
jensgram