Help
Ask questions about how to do or fix things in Arrowchat
User avatar
zoxtrix
Customer
 
Posts: 74
Joined: 29 Jun 2019, 19:31

 

by zoxtrix 04 Jan 2021, 12:04

I want to increase the maximum file upload size. I've tried altering the arrowchat/includes/classes/class_uploads.php file by adjusting the code section below, but it made no difference. I'm hoping to be able to upload .txt files that are 10MB in size or less. Changing the max file size value shown below from 1048576 to 10485760 still renders the file "too large" error message upon a 9MB .txt file upload attempt.
Code: Select all
                                // Exit if the image is too large
                                if ($_FILES['Filedata']['size'] > ($max_upload_size * 1048576))
                                {
                                        http_response_code(500);
                                        exit;
                                }
Is there something else I need to change? Any thoughts?
User avatar
Jason
Customer
 
Posts: 2329
Joined: 12 Dec 2009, 16:06

 

by Jason 04 Jan 2021, 13:08

Try changing the max upload limit in the admin panel.
User avatar
zoxtrix
Customer
 
Posts: 74
Joined: 29 Jun 2019, 19:31

 

by zoxtrix 04 Jan 2021, 16:47

Try changing the max upload limit in the admin panel.
Oh gee... it couldn't have been more obvious. Thanks!
User avatar
zoxtrix
Customer
 
Posts: 74
Joined: 29 Jun 2019, 19:31

 

by zoxtrix 04 Jan 2021, 18:19

Well, this is puzzling... I set the CP max file size variable to 15 (15 MB). Doing so allowed the test file (9 MB) to *appear* to upload properly. That is, a file transfer status bar appeared and took the appropriate amount of time to finish, after which the transfer dialog displayed the word "Complete" and a clickable link appeared in both the source client's chat window and the destination client's chat window. The problem is that clicking on either link merely redirected the browser tab to a blank white page with the following URL in the address bar:

https://www.my_domain.com/website_name/arrowchat/public/download.php?file=1609807853985

Additionally, there is no file named 1609807853985.txt in the arrowchat/uploads directory.

I tried this transfer test several more times using various browsers. The same result occurred, with the only difference being a new file name (number string) each time. I also conducted a transfer test using a much smaller .txt file (2KB). The smaller file transferred to the arrowchat/upload directory fine and upon clicking the link in the chat window an option was presented to either open or download the file (no blank white page with the smaller file).

From the root account on the server, I issued an updatedb, followed by a loacate 1609807853985.txt . No such file exists on the server.

Do you have any thoughts on this, Jason?
User avatar
zoxtrix
Customer
 
Posts: 74
Joined: 29 Jun 2019, 19:31

 

by zoxtrix 05 Jan 2021, 12:47

I've sorted it. I merely needed to look to the error_log. As it turns out, the post_max_size directive in my php.ini file was set to 8M. I set it to 15M, restarted the server, and voila! So all is well.