Hello,
I use image crud and i want to upload image files (jpg, png, gif). But image crud allows me to upload anything (txt, mpeg...).
How can i get restrictions ?
I try to change the 'accept_file_types' in libraries/image_crud.php => 'accept_file_types' => '/.[gif|jpeg|jpg|png]$/i'
But it doesn't work. And the application/config/image_crud doesn't have a line like :
$config['image_crud_file_upload_allow_file_types'] = 'gif|jpeg|jpg|png';
Thanks for your help and sorry for my english


How to validate the format of the image in image crud?
Started by J-c, Jan 15 2013 08:28 PM
imagecrud upload format
4 replies to this topic
#1
Posted 15 January 2013 - 08:28 PM
#2
Posted 16 January 2013 - 05:00 PM
nobody ?

#3
Posted 17 January 2013 - 10:52 AM
Hi J-c and welcome on GC.
Take a loock at class ImageUploadHandler on librarie/image_crud.php (~ line 552)
Take a loock at class ImageUploadHandler on librarie/image_crud.php (~ line 552)
// The php.ini settings upload_max_filesize and post_max_size // take precedence over the following max_file_size setting: 'max_file_size' => null, 'min_file_size' => 1, 'accept_file_types' => '/.+$/i', 'max_number_of_files' => null,Maby it can help you.
#4
Posted 18 January 2013 - 06:11 PM
Hi tlc033,
thank you for your answer!
I try everything but nothing works :
I don't know why.
is it works for you ?
thank you for your answer!
I try everything but nothing works :
//'accept_file_types' => '/.[gif|jpeg|jpg|png]$/i', //'accept_file_types' => 'gif|jpeg|jpg|png', //'accepted_file_types' => '/(\\.|\\/)(gif|jpeg|jpg|png)$/i', 'accept_file_types' => 'png',
I don't know why.
is it works for you ?
#5
Posted 20 January 2013 - 07:34 PM
Corrected here by web-johnny : http://www.grocerycr...-vulnerability/
Also tagged with one or more of these keywords: imagecrud, upload, format
Support →
Grocery CRUD Enterprise →
setFieldBlobStarted by MustafaPHP, 21 Apr 2020 ![]() |
|
![]() |
||
Support →
I have a question →
Change date format in relation_n_n Name StringStarted by Timti, 02 Dec 2019 ![]() |
|
![]() |
||
Support →
Bugs / Issues →
Problem posting/inserting content that contains an urlStarted by Chriz, 27 Aug 2019 ![]() |
|
![]() |
||
Support →
I have a question →
store image file into database from grocery crudStarted by jep, 07 Dec 2018 ![]() |
|
![]() |
||
Support →
I have a question →
Change file path on list viewStarted by Eduardo, 04 Feb 2018 ![]() |
|
![]() |
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users