I am having an issue when uploading a file in the add or edit views:
We can't process the response of the server. This is all we know about it:
Everything else is working properly I can even look at the files in the views.
Here is the code of my controller:
public function stockcolor()
{
$crud = $this->_getGroceryCrudEnterprise();
$crud->setCsrfTokenName(csrf_token());
$crud->setCsrfTokenValue(csrf_hash());
$crud->setTable('stock_color');
$crud->setSubject('Stock Color', 'Stock Color');
$crud->setLanguage('Spanish');
$crud->displayAS('name','Stock Color');
$crud->displayAS('coleccion_id','Colección');
$crud->displayAS('img_thumbnail','Imagen Miniatura (200x200px)');
$crud->displayAS('img_banner','Imagen Banner (300x1200px)');
$crud->displayAS('img_full','Imagen Completa (1920x1080px)');
$crud->displayAS('img_full2','Imagen Estampados (1920x1080px)');
$uploadValidations = [
'maxUploadSize' => '20M', // 20 Mega Bytes
'minUploadSize' => '1K', // 1 Kilo Byte
'allowedFileTypes' => [
'gif', 'jpeg', 'jpg', 'png', 'tiff'
]
];
$crud->setFieldUpload('img_thumbnail', base_url() . '/assets/images/estampados', base_url() . '/assets/images/estampados',$uploadValidations);
$crud->setFieldUpload('img_banner', '/assets/images/estampados', base_url() . '/assets/images/estampados',$uploadValidations);
$crud->setFieldUpload('img_full', '/assets/images/estampados', base_url() . '/assets/images/estampados',$uploadValidations);
$crud->setFieldUpload('img_full2', '/assets/images/estampados', base_url() . '/assets/images/estampados',$uploadValidations);
$crud->setRelation('coleccion_id','coleccion','name');
$output = $crud->render();
/*se agregan las variables para el menú*/
$coleccion = new ColeccionModel();
$output -> colecciones = $coleccion->orderBy('name', 'DESC')->findAll(2);//traemos las 2 colecciones más recientes
$output -> colecciones_viejas = $coleccion->orderBy('name', 'DESC')->findAll(10,2);//traemos las 10 colecciones siguientes
return $this->_example_output($output);
}
I hope you guys can help me I have wasted a lot of hours trying to understand what is going on and this is the last part to finish my GC setup.