General discussion
File size over 8MB not uploading regardless of the file size limit

Hi,


After installing codoforum and attempting to upload some files, I noticed that regardless of the file size limit set, the files that are around 8MB or above would fail to upload without error message from the forum.


When I attempt to upload these files, after the selecting the files and clicking upload, the green bar will and the checkmark will show up, but the window for file upload will not close and the link to the file won't be present in the textbox.


When I check the attachment directory, the file I tried to upload is not there. The following error shows up when I open the console on the browser.


606cabe4df9fe


Would like to know what could be done to resolve this issue. Thanks.


Hi, After installing codoforum and attempting to upload some files, I noticed that regardless of the file size limit set, the files that are around 8MB or above would fail to upload without error message from the forum. When I attempt to upload these files, after the selecting the files and clicking upload, the green bar will and the checkmark will show up, but the window for file upload will not close and the link to the file won't be present in the textbox. When I check the attachment directory, the file I tried to upload is not there. The following error shows up when I open the console on the browser. ![606cabe4df9fe](serve/attachment&path=606cabe4df9fe) Would like to know what could be done to resolve this issue. Thanks.
edited Apr 6 at 7:51 pm

Hi


Can you check the max post size limits in PHP?


We would also want to have a look at the error. Can you give link to your forum?


Hi Can you check the max post size limits in PHP? We would also want to have a look at the error. Can you give link to your forum?
Necessity is the mother of all inventions!

upload_max_filesize is set as 100MB in php.ini. Attachments directory's size is below 4MB at the moment.


As for the link, I am not really able to share it as I'm hosting this forum on a local machine with Ubuntu 16.04 via local private network.


However I'm experiencing this right after the fresh installation following this guide.
I made no other changes to the source and the settings other than the configurations recommended by the above guide, increasing the file size limit from the default value on the admin page and allowed file types.


Are there some particular information you need to test or take a look at that I can help you find? If you do need the forum link itself, I can set up another forum environment on the cloud and provide you its link once the issue is replicated there.


**upload_max_filesize** is set as 100MB in php.ini. Attachments directory's size is below 4MB at the moment. As for the link, I am not really able to share it as I'm hosting this forum on a local machine with Ubuntu 16.04 via local private network. However I'm experiencing this right after the fresh installation following [this guide](https://websiteforstudents.com/how-to-install-codoforum-on-ubuntu-18-04-16-04-with-apache2/). I made no other changes to the source and the settings other than the configurations recommended by the above guide, increasing the file size limit from the default value on the admin page and allowed file types. Are there some particular information you need to test or take a look at that I can help you find? If you do need the forum link itself, I can set up another forum environment on the cloud and provide you its link once the issue is replicated there.
edited Apr 7 at 11:18 pm

Hi


Since it is a local installation you will have to help us a little with the debugging.


In your developer tools, open the network tab and then upload a file. There should be an xhr request made, click on it and check the response. Do you see any errors there?


Hi Since it is a local installation you will have to help us a little with the debugging. In your developer tools, open the network tab and then upload a file. There should be an xhr request made, click on it and check the response. Do you see any errors there?
Necessity is the mother of all inventions!

I believe this is the one.


606f31a139f64


I believe this is the one. ![606f31a139f64](serve/attachment&path=606f31a139f64)

Invalid CSRF token


The error message "invalid CSRF" is unfortunately not really meaningful enough - does not help a lot.


This error message means that your setup system couldn’t access the tocken in your cookie.


This can be caused by ad- or script-blocking plugins, by a overloaded cache, by a faulty HTTP header request or your setup is running into a timeout exceeded issue etc etc.


Lets see what @admin says about it smile

Good luck man smile


**Invalid CSRF token** The error message "invalid CSRF" is unfortunately not really meaningful enough - does not help a lot. This error message means that **your setup system couldn’t access the tocken in your cookie**. This can **be caused** by ad- or **script-blocking plugins**, by a overloaded cache, by a faulty HTTP header request or your setup is running into a timeout exceeded issue etc etc. Lets see what @admin says about it :) Good luck man :)
edited Apr 9 at 11:32 pm

Hi


Do you get this same error every time you upload a big file? Can you check what response you get when uploading a small file?


Also can you check in the request headers if there is a token being passed?


Hi Do you get this same error every time you upload a big file? Can you check what response you get when uploading a small file? Also can you check in the request headers if there is a token being passed?
Necessity is the mother of all inventions!
edited Apr 10 at 6:58 am

Files under around 8 MB that are uploaded successfully just have responses with the file name, like [{"name":"6074751c14d21"}].


Headers for both the uploads that succeed and fail have a token being passed.


Files under around 8 MB that are uploaded successfully just have responses with the file name, like [{"name":"6074751c14d21"}]. Headers for both the uploads that succeed and fail have a token being passed.

Hi


Can you try this: Open sys/Controller/Ajax/forum/topic.php


Around line 253, replace


        echo json_encode($file_info);

with


        echo json_encode(count($errors) > 0 ? [
"error" => join("\n", $errors),
] : $file_info);

Now, upload a large file and check the response of the request, do you see any errors?


Hi Can you try this: Open sys/Controller/Ajax/forum/topic.php Around line 253, replace ``` echo json_encode($file_info); ``` with ``` echo json_encode(count($errors) > 0 ? [ "error" => join("\n", $errors), ] : $file_info); ``` Now, upload a large file and check the response of the request, do you see any errors?
Necessity is the mother of all inventions!

I applied the change and I'm still receiving the same error. Same errors in the xhr response as before as well.


I applied the change and I'm still receiving the same error. Same errors in the xhr response as before as well.

I just set up a new forum instance on a VM with public IP and replicated the issue there. Hopefully this can help identify the issue more easily.


@admin I will PM you the link to the new forum.

I just set up a new forum instance on a VM with public IP and replicated the issue there. Hopefully this can help identify the issue more easily. @admin I will PM you the link to the new forum.
edited Apr 16 at 1:02 am

Hi


Thank you. That helps.
You can email us the link and a test account details.


Hi Thank you. That helps. You can email us the link and a test account details.
Necessity is the mother of all inventions!
163
12
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft