0
Hello, I’m having trouble writing in a directory in Laravel 5.6, I created the directory on the server and when I will upload it gives this error:
unable to write in the "uploads/imagens/assinatura" directory
curious that I have another "avatar" directory and use the same way to save images in both. I can save on the internal server, but when I go up I can’t, follow the code:
Code saved in "signature" that says I don’t have permission:
if($request->hasFile('ds_ass')){
$destino = 'uploads/imagens/assinatura';
$arquivo = $request->ds_ass;
$nmArquivo = $id.'-'.date('d').'-'.date('m').'-'.date('Y').'-'.date('i').'-'.date('s');
$extensao = $arquivo->getClientOriginalExtension();
$nomeArquivo = $nmArquivo.'.'.$extensao;
$arquivo->move($destino,$nomeArquivo);
$foto = $arquivo;
$salvaFoto = new \App\Anexos;
$salvaFoto->ID_CD_PESSOA = $id;
$salvaFoto->DS_ARQUIVO = $nmArquivo;
$salvaFoto->DS_EXTENSAO = $extensao;
$salvaFoto->save();
$fotoprof = $prof::find($idProf);
$fotoprof->DS_ASSINATURA = $nomeArquivo;
$fotoprof->save();
}else{
...
Code that runs error-free:
if($request->hasFile('ds_arquivo')){
$destino = 'uploads/imagens/avatar';
$arquivo = $request->ds_arquivo;
$nmArquivo = $id.'-'.date('d').'-'.date('m').'-'.date('Y').'-'.date('i').'-'.date('s') ;
$extensao = $arquivo->getClientOriginalExtension();
$nomeArquivo = $nmArquivo.'.'.$extensao;
$arquivo->move($destino,$nomeArquivo);
$foto = $arquivo;
$salvaFoto = new \App\Anexos;
$salvaFoto->ID_CD_PESSOA = $id;
$salvaFoto->DS_ARQUIVO = $nmArquivo;
$salvaFoto->DS_EXTENSAO = $extensao;
$salvaFoto->save();
$fotoPessoa = \App\Pessoas::find($id);
$fotoPessoa->DS_FOTO = $nomeArquivo;
$fotoPessoa->save();
}else{
...
I managed to give permission through the server, thank you.
– André Tripode Colognesi