mahammadsxiyev's avatar

image upload permission in server

Hi, when i upload image with dropzone i get Unable to write in the "cdn/products" directory. error i try all permission task

$request->file('file')->move('cdn/products',$imagename); <- return error function

0 likes
4 replies
bugsysha's avatar

Just give correct permissions.

chmod 775 -R pathToFolder
mahammadsxiyev's avatar

i fixed but when i upload image image not readable, how can upload readable

bugsysha's avatar

Give more info on permissions and your flow.

mahammadsxiyev's avatar
mahammadsxiyev
OP
Best Answer
Level 1

source of problem hosting public dir i solve problem with method. I add this function in bootstrap/app.php

$app->bind('path.public', function() {
  return __DIR__;
});

Please or to participate in this conversation.