phpcodeignitergrocery-crud

Grocery Crud - Set the allowed file types in upload field


My question is similar to this one http://www.grocerycrud.com/forums/topic/169-allowed-types-for-file-upload/

The answer there is no longer updated.

how can I set allowed types for file upload in grocery crud with the version 1.4? Could the file types be set directly from the function? Something like this one:

$crud->set_upload_file_types('jpg','apk');

Thanks


Solution

  • At this moment you can not change it directly from the controller function. But you can change it from the config file at your application/config/grocery_crud.php

    $config['grocery_crud_file_upload_allow_file_types'] = 'gif|jpeg|jpg|png|tiff|doc|docx|txt|odt|xls|xlsx|pdf|ppt|pptx|pps|ppsx|mp3|m4a|ogg|wav|mp4|m4v|mov|wmv|flv|avi|mpg|ogv|3gp|3g2|apk';