[Skip to main content](#vessel-content)

#   Change upload limit for files

##

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 months ago [\#307920](#307920) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#307920 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")* was created by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")*

It is possible to change file size on front-end product creation?
I need to change it dynamically depending on user group.
A lot of thanks for your help!!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

7 years 4 months ago [\#307939](#307939) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#307939 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Hello,

There is no setting in the current HikaMarket version to override the max upload file size per vendor group.
In HikaShop 3.5.0, the uploader javascript library got an update with various improvements ; one of them was a better support of the upload limitations (know the different between the server limitation and the limitation we want).

In HikaMarket, there is some "waiting" code in order to have an upload limitation size in the server side.
The idea is to modify the line Code:

$options['max_file_size'] = null;

in the HikaMarket product controller.

But the user won't see that upload limitation since it's all coming from the uploader javascript lib which is in HikaShop.
I think that it would require some modifications in the HikaShop uploader type so it would have options to tweak these values.
But, if you do set the max_file_size in HikaMarket, the restrictions will be applied on server side, so the upload will be refused if the file is bigger than the set-up value (that you can make it dynamic depending the vendor group).
Of course the best would be to have an options like the other "vendor options" that you can find in the HikaMarket backend ; but I would highly prefer to also have the option available in the uploader type so the vendor will be aware of the restriction before it starts the upload and more than a text within the uploader zone.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 months ago [\#307945](#307945) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#307945 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Perfect. Making modifications to this line $options = null; is perfect.
There is a way to make this modification without edit the core code maybe with a plugin?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

7 years 4 months ago [\#307981](#307981) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#307981 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Hello

There is no trigger in the HikaMarket product controller (and there is not a lot of triggers within controllers).
But I guess that it could be interesting to have a trigger for that, not in the HikaMarket product controller but in the upload one.
Thanks to that, by modifying one single file you will have access to every section which is using the upload system, even plugin controllers !
The idea is to place the trigger call just after the : Code:

... = $this-&gt;controller-&gt;getUploadSetting(...

And regarding the parameters, I think it will be interesting to have the $uploadConfig, $this-&gt;controller, $upload_key and $caller.

I'll add a feature request ticket in my side.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 months ago [\#307990](#307990) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#307990 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Perfect. Thanks for your help Jerome.
Best Regards !!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 months ago [\#307992](#307992) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#307992 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

I just have another question but let me know if I need to open another Topic. There's a variable like $options to modify file extensions?
Best Regards!!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 months ago -  7 years 4 months ago [\#307993](#307993) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#307993 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Do you have an idea why this code just works for 20MB limit?
$user = JFactory::getUser();
$groups = JAccess::getGroupsByUser($user-&gt;id);
$seller_premium_group_id = 12;
$search_group = array_search($seller_premium_group_id, $groups);
if($search_group != false) {
$options = 1048576000;
} else {
$options = 209715200;
}
The idea is all groups that are not Premium Seller can upload files 200MB max and Seller Premium up to 1GB. The thing is the 200MB doesn't works, but for example if I set the limit to 2MB it works well, just doesn't works when I try to limit bigger files.

Last edit: 7 years 4 months ago by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

7 years 4 months ago [\#308013](#308013) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#308013 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Hello,

I'm sorry but between the code and your number, I'm not able to understand what is going on.
Right now, I don't see the relation between the code you pasted (please use the "code" tag for that) and your limitation issue.
Afterwards, you're talking about 200MB, 20MB and 2MB but it's not possible to understand the context or else.
Nor to understand "doesn't works" means.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 months ago -  7 years 4 months ago [\#308039](#308039) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#308039 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Code:

$user = JFactory::getUser(); $groups = JAccess::getGroupsByUser($user-&gt;id); $seller_premium_group_id = 12; $search_group = array_search($seller_premium_group_id, $groups); if($search_group != false) { $options = 1048576000; } else { $options = 209715200; }

Yes you are right. So sorry, I will try to explain me better. When I say "doesn't work" means if I set limit to 209715200 B (200MB) I can still upload files bigger than 200MB. But I set the limit to 2097152 B (2MB) the limit it works well and any file bigger than 2MB successfully get and error about file limit size restriction.

Last edit: 7 years 4 months ago by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

7 years 4 months ago [\#308042](#308042) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#308042 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Hello,

Thanks for the clarification !

The problem is related to the chunk system, the first check is made when the upload is made but only on the chunk size ; so if you have multiple chunks, you need to add another test.
In the administrator/com_hikamarket/helpers/upload file you need to replace Code:

} else if(!empty($this-&gt;options['max_file_size']) &amp;&amp; $file-&gt;size &gt; $this-&gt;options['max_file_size']) { $file-&gt;error = 'maxFileSize';

By Code:

} else if(!empty($this-&gt;options['max_file_size']) &amp;&amp; $file-&gt;size &gt; $this-&gt;options['max_file_size']) { $file-&gt;error = 'maxFileSize'; } else if(!empty($this-&gt;options['max_file_size']) &amp;&amp; isset($slice['total_size']) &amp;&amp; $slice['total_size'] &gt; $this-&gt;options['max_file_size']) { $file-&gt;error = 'maxFileSize';

And the limitation will be made too.
(We will add that patch in our side too)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 months ago [\#308305](#308305) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#308305 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Works perfect. A lot of thanks for your help !!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 4 weeks ago [\#312154](#312154) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#312154 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Hi Jerome. How are you?
I just wondering. It is possible to use the new triggers on 4.2.1 release for this goal?
onBeforeFileCreate onBeforeFileUpdate onAfterFileCreate and onAfterFileUpdate.
A lot of thanks for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

7 years 3 weeks ago [\#312195](#312195) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#312195 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Hello,

I'm not sure that HikaShop have the patch for that.
Best would be to ask the HikaShop support team, via the HikaShop section of the forum.

Regards

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")**
- [![OPHWD's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/58074-ophwd "View OPHWD's Profile") Topic Author
- [ Offline](/forum/user/58074-ophwd)

Less More

- Posts: 19
- Thank you received: 0
-
-

7 years 3 weeks ago [\#312206](#312206) by [OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")  Replied by *[OPHWD](/forum/user/58074-ophwd "View OPHWD's Profile")* on topic *[Change upload limit for files](/forum/23-market-how-to/897735-change-upload-limit-for-files#312206 "It is possible to change file size on front-end product creation? I need to change it dynamically depending on user group. A lot of thanks for your help!!")*

Thanks for your great support Jerome. I'm opening a new case on HikaShop.
Have a great day !!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODk3NzM1LWNoYW5nZS11cGxvYWQtbGltaXQtZm9yLWZpbGVzP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.077 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
