\documentclass{article}
\usepackage{ulem}
\pagestyle{headings}
\begin{document}
\tableofcontents

\part{ File Uploads}
Original source/credit for this text goes to: http://www.radinks.com/upload/config.php\footnote{http://www.radinks.com/upload/config.php}

\section{ php.ini}
All the configuration settings for your PHP installation are contained in the php.ini file. Sometimes these setting might be overridden by directives in apache .htaccess files or even with in the scripts themselves. However you cannot override the settings that affect file uploads with .htaccess directives or inside scripts in this way.

You can call the phpinfo() function to find the location of your php.ini file, it will also tell you the current values for the following settings that you may need to modify:

\begin{itemize}
\item{file\_uploads}
\item{upload\_max\_filesize}
\item{max\_input\_time}
\item{memory\_limit}
\item{max\_execution\_time}
\item{post\_max\_size}
\end{itemize}
The first one is fairly obvious: if you turn it off, uploading is disabled for your installation.

\subsection{ upload\_max\_filesize and post\_max\_size}
Files are usually POSTed to the webserver in a format known as 'multipart/form-data'. The post\_max\_size sets the upper limit on the amount of data that a script can accept in this manner. Ideally this value should be larger than the value that you set for upload\_max\_filesize.

It's important to realize that upload\_max\_filesize is the sum of the sizes of all the files that you are uploading. post\_max\_size is the upload\_max\_filesize plus the sum of the lengths of all the other fields in the form plus any mime headers that the encoder might include. Since these fields are typically small you can often approximate the upload max size to the post max size.

\subsection{ memory\_limit}
When the PHP engine is handling an incoming POST it needs to keep some of the incoming data in memory. This directive has any effect only if you have used the --enable-memory-limit option at configuration time. Setting too high a value can be very dangerous because if several uploads are being handled concurrently all available memory will be used up and other unrelated scripts that consume a lot of memory might effect the whole server as well.

\subsection{ max\_execution\_time and max\_input\_time}
These settings define the maximum life time of the script and the time that the script should spend in accepting input. If several mega bytes of data are being transfered max\_input\_time should be reasonably high. You can override the setting in the ini file for max\_input\_time by calling the set\_time\_limit() function in your scripts.

\section{ Apache Settings}
The Apache webserver has a LimitRequestBody configuration directive that restricts the size of all POST data regardless of the web scripting language in use. Some RPM installations sets limit request body to 512Kb. You will need to change this to a larger value or remove the entry altogether.

\section{ Other Configuration Tips}
See this FAQ entry\footnote{http://wiki.horde.org/FAQ/Admin/Config\#attachment-size}.

\end{document}
