The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

There does seem to be a lot of confusion from people on this. I've even seen some people erroneously stating that your file isn't uploaded until you use move_uploaded_file on it - this just simply is not true!

Your script won't even begin to execute until the file has been fully uploaded to your server. This right away should answer your question regarding when "upload_max_filesize" is applied - the file is already uploaded long before you have the opportunity to use move_uploaded_file. If you doubt it, upload a file that exceeds this setting, then check $_FILES['userfile']['error'] before you execute move_uploaded_file. You'll see the error UPLOAD_ERR_INI_SIZE (integer value 1), and the file won't even be available to you to run move_uploaded_file on.

Using ini_set on upload_max_filesize will not have any effect, since changes made to the .ini settings through this function are valid only for the execution of the current script. Since file upload happens after your form script has finished executing but before your processing script begins, it has absolutely no effect on your file size limit.

The maximum file size set by default is usually as big as should be used for uploading files via the extremely inefficient method that the method provides. If your files are getting anywhere near that big or are even bigger than that then you should be using the ftp extension to PHP to do the file uploads since that is designed for file transfers and does so as efficiently as possible where the simpler method is not efficient and can tie up all the resources on the server for a long period if you try uploading a larger file.