Reply to Re: [PHP] Bypassing php.ini setting for file uploads?

Your name:

Reply:


Posted by Richard Lynch on 03/02/05 20:45

Matt Cassarino wrote:
> I am trying to modify the php.ini settings for post_max_size and
> upload_max_filesize to allow for a custom script to upload files larger
> than 8MB, the default size limit set in php.ini. This is on a shared
> server, and my hosting company won't modify the limitation, although they
> will charge me $50/hr to code a custom script. Whatever! I'll just do it
> myself... but I don't know how.
>
> Also, http://docs.php.net/en/function.ini-set.html tells me that for
> post_max_size and upload_max_filesize: "Entry can be set in php.ini,
> .htaccess or httpd.conf."

Some Good News

You can create a file named ".htaccess" in the same directory as your file
upload script, and put this in it:

php_value post_max_size 32M
php_value upload_max_filesize 32M

Use any valid value you like instead of 32M of course.

Yes, there really *should* be a dot (.) at the front of the filename:
..htaccess

Your FTP software and your desktop machine may give you grief about it,
but the web-server *needs* it to be that name.

If you already have an .htaccess file with other stuff in it, which you
may or may not understand, just add the above lines at the bottom.

Their custom script would have to do this exact same thing to make it
work, so there ain't much point to giving them $50/hr for that. :-)


Some Bad News

Your web host *might* have .htaccess turned "off" for performance reasons,
in which case you are screwed.

It's unlikely, but possible.

They ain't gonna turn .htaccess "on" just for you, because then it's "on"
for everybody and slows down the server a little bit.

And they probably won't even change the settings for max_XYZ in httpd.conf
for you, not even for $50. If by some chance they *will* do that, it's a
2-minute job, so don't let them charge you more than $50 for that!

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация