- Posts: 19
- Thank you received: 0
Change upload limit for files
I need to change it dynamically depending on user group.
A lot of thanks for your help!!
Please Log in or Create an account to join the conversation.
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
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 & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
There is a way to make this modification without edit the core code maybe with a plugin?
Please Log in or Create an account to join the conversation.
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 :
I'll add a feature request ticket in my side.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Best Regards !!
Please Log in or Create an account to join the conversation.
Best Regards!!
Please Log in or Create an account to join the conversation.
$user = JFactory::getUser();
$groups = JAccess::getGroupsByUser($user->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.
Please Log in or Create an account to join the conversation.
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 & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
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
And the limitation will be made too.
(We will add that patch in our side too)
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
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 & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
Have a great day !!
Please Log in or Create an account to join the conversation.