Can't upload file >200MB

Keywords: Moodle - AWS - Technical issue - Application configuration

bndiagnostic ID: 6ec53a93-f4a1-894c-8fb0-ce264eed5277

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/

bndiagnostic failure reason: The documentation did not make any significant change

Description:
I am unable to upload a file bigger than 200MB either by drag/drop or File Picker/Upload a file. I am able to upload files <200MB with no issues. Previously, I was able to upload large files. I’ve tried in various browsers. I receive the following popup: Error connecting to the server. No errors in Debugging mode.

Moodle: Moodle 3.11.7+ (Build: 20220603)
Debian GNU/Linux 10 (buster)

Moodle settings:
moodlecourse | maxbytes - Site upload limit (8GB)
Security / Site security settings | maxbytes - Site upload limit (8GB) - Error message: Invalid current value: 8589934592

AWS EC2 Instance info:
t2.small
Volume size 100GB

php.ini settings:

post_max_size = 800M
upload_max_filesize = 800M
max_execution_time = 600

httpd.conf settings:

LimitRequestBody not included.
Added LimitRequestBody 16384 as per Modify the PHP file upload limit
No effect.
Removed, no effect.

From Bitnami Diagnostic tool: “Your instance has little available RAM memory.”
Initial memory -

              total        used        free      shared  buff/cache   available
Mem:           1995         574         484         109         936        1128
Swap:             0           0           0

After following instructions here:Increase the available memory

              total        used        free      shared  buff/cache   available
Mem:           1995         457         324          65        1212        1288
Swap:          1023           1        1022

No effect.

I hope I provided enough information!

I did some more digging…

I found this post File Upload size decrease to 2mb ( initially was 80 mb) after increasing size to 500 mb - #10 by davidg

I performed a search for “post-max-size” and found the following:

/opt/bitnami/bndiagnostic/original-data/php/etc/php.ini
694:post_max_size = 80M

/opt/bitnami/php/etc/php.ini
694:post_max_size = 800M

/opt/bitnami/php/etc/php.ini-production
694:post_max_size = 8M

/opt/bitnami/php/etc/php.ini-development
694:post_max_size = 8M

And for “upload_max_filesize”:

/opt/bitnami/bndiagnostic/original-data/php/etc/php.ini
846:upload_max_filesize = 80M

/opt/bitnami/php/etc/php.ini
846:upload_max_filesize = 800M

/opt/bitnami/php/etc/php.ini-production
846:upload_max_filesize = 2M

/opt/bitnami/php/etc/php.ini-development
846:upload_max_filesize = 2M

Do I need to update these files too?

You do not need to edit the other files, just the /opt/bitnami/php/etc/php.ini one.

However, the limit can be also set in the application. Could you please take a look at the official documentation and ensure all limits are higher than 200M?

https://docs.moodle.org/400/en/File_upload_size

Thank you for your response!

In Site security settings, Maximum uploaded file size = Site upload limit (800MB)

In Course settings, Maximum upload size = Site upload limit (800MB)

/opt/bitnami/php/etc/php.ini
post_max_size = 800M
upload_max_filesize = 800M
max_execution_time = 600

/opt/bitnami/apache2/conf/httpd.conf
No reference to LimitRequestBody

I also tried adding a .htaccess file in my root folder with the following:
LimitRequestBody 0
php_value upload_max_filesize 800M
php_value post_max_size 800M

Still no change.

Hi @amanda.chan ,

If you have updated all those parameters and restarted the services

sudo /opt/bitnami/ctlscript.sh restart

the application should be accepting big files. However, if that’s not the case, I suggest you contact the Moodle’s support team just in case there is any other parameter to configure.

https://moodle.org/mod/forum/view.php?id=7135