Page 1 of 1

config_file_max_size not doing anything.

Posted: Thu Feb 06, 2020 9:35 pm
by dharmawebstudio
Hello to everybody.

In latest version OC 3.0.3.2; it can be found a field in Store Settings > Server Tab named "config_file_max_size".
I understand this value should limit the uploads file size, in front store and admin both.

I think this is not working for anything.
If you make a search of that string in the code "config_file_max_size"; the only reference is in controller and view of store setting form page in admin.

Please, somebody could check this; and tell me if i am wrong ... ?

Thanks.

Re: config_file_max_size not doing anything.

Posted: Thu Feb 06, 2020 10:02 pm
by dharmawebstudio
I think i understand what`s going on about this.

The uploads errors comes from PHP "$_FILES['filename']['error']." variable, to detect errors.
https://www.php.net/manual/es/features. ... errors.php

However, there is not "MAX_FILE_SIZE " field, inside any form; so i think this is not working .

Re: config_file_max_size not doing anything.

Posted: Thu Feb 06, 2020 10:51 pm
by cyclops12
As i see it it is just for image upload size
max-file-size.png

max-file-size.png (10.47 KiB) Viewed 3867 times


Re: config_file_max_size not doing anything.

Posted: Thu Feb 06, 2020 11:09 pm
by letxobnav
It is there, just not used I believe just like bots.

Re: config_file_max_size not doing anything.

Posted: Fri Feb 07, 2020 1:08 am
by dharmawebstudio
letxobnav wrote:
Thu Feb 06, 2020 11:09 pm
It is there, just not used I believe just like bots.
I think you are right. Bots is not doing anything either.
it´s just a placebo -.... what a mess ??? ??? ???

Re: config_file_max_size not doing anything.

Posted: Fri Feb 07, 2020 1:11 am
by dharmawebstudio
I create these lines of code to fix this in OC 3.0.3.2. It just works with the file manager. There is another places that should be considered, but it´s a start.
I will also take the time to report this on the repository.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <name>Upload max file size patch</name>
    <version>1.0</version>
    <code>DWS-UPLOAD-MAX-FILE-SIZE-PATCH</code>
    <author>Dharma Web Studio</author>
    <link>https://dharmawebstudio.com</link>
    <file path="admin/controller/common/filemanager.php">
        <operation>
            <search><![CDATA[if (!in_array($file['type'], $allowed)) {]]></search>
            <add position="before"><![CDATA[
        
                    if ($file['size'] > $this->config->get('config_file_max_size')) {
                        $json['error'] = $this->language->get('error_upload_2');
                    }

                ]]>
            </add>
        </operation>
    </file>
</modification>

Re: config_file_max_size not doing anything.

Posted: Fri May 29, 2020 6:58 am
by straightlight
I have notified Daniel about this today. This variable key has been leftover for quite some time now ...

Re: config_file_max_size not doing anything.

Posted: Fri May 29, 2020 1:30 pm
by dharmawebstudio
Thanks for check this @straightlight.

I have would liked to collaborate with this directly in the repo, but I usually get tangled up in the workflow when I want to send a pull request. I will try to do it next time...

Re: config_file_max_size not doing anything.

Posted: Fri May 29, 2020 6:55 pm
by straightlight
dharmawebstudio wrote:
Fri May 29, 2020 1:30 pm
Thanks for check this @straightlight.

I have would liked to collaborate with this directly in the repo, but I usually get tangled up in the workflow when I want to send a pull request. I will try to do it next time...
I'm already in the repo as we speak for the pre-release version of OC that will be downloadable from the Opencart Github namespace. I will create a sticky topic in this forum section shortly to inform the people about the speed up of the bug fixes.

Re: config_file_max_size not doing anything.

Posted: Fri May 29, 2020 7:11 pm
by xxvirusxx
straightlight wrote:
Fri May 29, 2020 6:55 pm
I'm already in the repo as we speak for the pre-release version of OC that will be downloadable from the Opencart Github namespace
You talk about 3.0.3.4?

Re: config_file_max_size not doing anything.

Posted: Fri May 29, 2020 7:13 pm
by straightlight
xxvirusxx wrote:
Fri May 29, 2020 7:11 pm
straightlight wrote:
Fri May 29, 2020 6:55 pm
I'm already in the repo as we speak for the pre-release version of OC that will be downloadable from the Opencart Github namespace
You talk about 3.0.3.4?
Yes.

Re: config_file_max_size not doing anything.

Posted: Fri May 29, 2020 7:16 pm
by xxvirusxx
You have access to merge commits?

https://github.com/opencart/opencart/pulls/condor2

I thought I'd do more pulls (for 3.0.3.4)..but no one care...

Re: config_file_max_size not doing anything.

Posted: Fri May 29, 2020 7:41 pm
by straightlight
xxvirusxx wrote:
Fri May 29, 2020 7:16 pm
You have access to merge commits?

https://github.com/opencart/opencart/pulls/condor2

I thought I'd do more pulls (for 3.0.3.4)..but no one care...
That will be subject to change. Soon, developers will simply have to post their commit changes and even post past relative solutions in order to increase those commit links. That way, everybody works together to speed things up. On the Opencart Github issues tab (for core bugs) and on the Pull Requests section (features), I will then review the feedbacks for the pre-release version. I spoke to Daniel about it recently. More information to come shortly on this.

Re: config_file_max_size not doing anything.

Posted: Tue Feb 16, 2021 4:09 am
by gokhanalpaslan
Change the value from setting table via phpmyadmin