- Posts: 126
- Thank you received: 2
Vendor can upload huge product images (58 MB)
11 years 3 months ago - 11 years 3 months ago #205290
by mett
Vendor can upload huge product images (58 MB) was created by mett
-- HikaShop version -- : 2.4.0
-- HikaMarket version -- : 1.6.2
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.6
-- Browser(s) name and version -- : Chrome 43
Hello,
Please tell me how can i limit the size of the uploaded file for the main image(s), i found that as a vendor i can upload a product image over 50 MB. For example, i uploaded a 58 MB tif image as main image, and at the end after one minute, i get the message that my webserver cannot render the picture.
I need to allow users to upload only of certain size for the product image (1-2 MB) (not files, the files for download can have even 100 MB, the max limit of my webserver), how can i do this?
Thank you
-- HikaMarket version -- : 1.6.2
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.6
-- Browser(s) name and version -- : Chrome 43
Hello,
Please tell me how can i limit the size of the uploaded file for the main image(s), i found that as a vendor i can upload a product image over 50 MB. For example, i uploaded a 58 MB tif image as main image, and at the end after one minute, i get the message that my webserver cannot render the picture.
I need to allow users to upload only of certain size for the product image (1-2 MB) (not files, the files for download can have even 100 MB, the max limit of my webserver), how can i do this?
Thank you
Last edit: 11 years 3 months ago by mett.
Please Log in or Create an account to join the conversation.
11 years 3 months ago #205299
by Jerome
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.
Replied by Jerome on topic Vendor can upload huge product images (58 MB)
Hi,
There is no option for the moment to limit the image file size ; but there is an option to limit the image dimension (width/height).
www.hikashop.com/support/documentation/1...l#config_main_editor
Regards,
There is no option for the moment to limit the image file size ; but there is an option to limit the image dimension (width/height).
www.hikashop.com/support/documentation/1...l#config_main_editor
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.
11 years 3 months ago #205372
by mett
Replied by mett on topic Vendor can upload huge product images (58 MB)
I've already set the image dimensions, but this doesn't stop the vendors to upload large files. It's not helpful for them (the image cannot be rendered) and for me also, i'll waste a lot of bandwidth allocated for nothing.
Please add this feature for the next release of HikaMarket.
Thank you
Please add this feature for the next release of HikaMarket.
Thank you
Please Log in or Create an account to join the conversation.
11 years 3 months ago #205413
by Jerome
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.
Replied by Jerome on topic Vendor can upload huge product images (58 MB)
Hi,
So at this moment I'll suggest use to use the "maxSize" option of the javascript upload library.
First, you will have to edit the file "administrator/components/com_hikashop/types/uploader.php" and replace
By
And then, in the view "productmarket | form_image", you can replace
By
It should give to the javascript library a size limitation for the image upload of 2MB (instead of reading the maximum upload size that your server can accept).
Regards,
So at this moment I'll suggest use to use the "maxSize" option of the javascript upload library.
First, you will have to edit the file "administrator/components/com_hikashop/types/uploader.php" and replace
Code:
$options['maxSize'] = min(hikashop_bytes(ini_get('upload_max_filesize')), hikashop_bytes(ini_get('post_max_size')));
Code:
$maxSize = min(hikashop_bytes(ini_get('upload_max_filesize')), hikashop_bytes(ini_get('post_max_size')));
if(empty($options['maxSize'])) {
$options['maxSize'] = $maxSize;
} else {
$size = (int)$options['maxSize'];
if((''.$size) != $options['maxSize'])
$size = hikashop_bytes($options['maxSize']);
$options['maxSize'] = min($size, $maxSize);
}
And then, in the view "productmarket | form_image", you can replace
Code:
'ajax' => $ajax
);
Code:
'ajax' => $ajax,
'maxSize' => '2M'
);
It should give to the javascript library a size limitation for the image upload of 2MB (instead of reading the maximum upload size that your server can accept).
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.
The following user(s) said Thank You: mett
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.227 seconds