Topic: file too large to upload error

I am using PunBB 1.3.4 on a Ubuntu 8.04 server. It is my own server so there is no problem with file size or access. However when uploading attachments I get this error:

Warning! The following errors must be corrected before your message can be posted:

    * The selected file was too large to upload. The server didn't allow the upload.

For testing, I have set the upload limit for all groups to 200MB. Yes I double checked the number of zeros. smile  A PDF of 1716545 bytes can be uploaded but a TXT file of 2791724 bytes cannot. Larger files, of course, are impossible. I have tried many files and sizes but just mention the above ones to show approximately where the size limit  is. I have tried the Firefox, Galeon, and Opera browsers.

I do notice that the error message is listed under "Avatar stuff" in profile.php. I do not allow avatars so perhaps that is connected.

After checking this thoroughly, I think it is a bug. Please forgive me if it is not.

Re: file too large to upload error

What is the maximum allowed size of an uploaded file in php.ini?

3 (edited by Ole Juul 2010-05-11 21:04)

Re: file too large to upload error

Slavok wrote:

What is the maximum allowed size of an uploaded file in php.ini?

Haha You nailed it! Thanks!

I was not familiar with that file. I assume that when I move the installation to a commercial server, that the numbers will be higher than the default ones that I had on my own server.

In case anyone else needs this information, here is what I found. Although I was able to upload files of any size to the server using normal methods, php has it's own built in controls. These can be found in /etc/php5/apache2/php.ini. The defaults on a UBUNTU LAMP install were 8M and 2M. I found that I had to change both of the the following parameters.

Maximum size of POST data that PHP will accept.
post_max_size = 8M;

Maximum allowed size for uploaded files.
upload_max_filesize = 2M