setFieldUpload Issue

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.

Maybe your line setFieldUpload…

setFieldUpload(string $fieldName, string $privateUploadFolder, string $publicFolderPath [, array $options])

try to remove the first base_url

$crud->setFieldUpload(‘img_thumbnail’, ‘/assets/images/estampados’, base_url() . ‘/assets/images/estampados’,$uploadValidations);

You probably have an error/warning or notice that it is not appearing. Try to add the change the ini file to display_errors and also the error reporting to be E_ALL. For more also check: How do I get PHP errors to display? - Stack Overflow

I tried that, however it did not worked

Checking the PHP.ini the display_errors variables is set to On, the error_reporting variables is set to E_ALL & ~E_DEPRECATED & ~E_STRICT. Also checking my .env file is pointing to development and the boot development file is set to: ini_set(‘display_errors’, ‘1’).

For other errors I have been able to see the full message, so maybe am I missing another variable to get the full error in this specific GC function?

Hello @catmancer ,

I guess this may be another issue with PHP 8.1 . Can you please confirm that you are using PHP 8.1 or later?

Also if you are using Codeigniter please try to change the environment on .env file to development

It is very possible that you are probably adding the E_ALL and then it gets removed by Codeigniter.

Last but not least, if you are using PHP 8.1 or later please make sure that you have the latest GCE version as only the latest one supports it (2.9.5)

Regards
Johnny