lundi 4 avril 2022

i can´t save my image or my file when upload it

My problem it´s, mi folder it´s created but my file it´s not uploaded. i have this code:

if(isset($request->file_job)){
            $pathFolder = storage_path('app/contratos/'.$tarea->contratoTrey->serie->SERIE.'-'.$tarea->contratoTrey->N_CONTRATO.'/tareas/T-'.$tarea->ntarea);
            $filePath = 'app/contratos/'.$tarea->contratoTrey->serie->SERIE.'-'.$tarea->contratoTrey->N_CONTRATO.'/tareas/T-'.$tarea->ntarea;
           
            if(!\File::exists($pathFolder)) {
                \File::makeDirectory($pathFolder, 0755, true, true);
            }
            
            \Storage::disk('local')->putFileAs($filePath, $request->file_job, ($request->file_job)->getClientOriginalName());
        }

this code generate all my folder structure but not save my file (image) i don´t know that i´m doing wrong.

Thanks for help me



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire