Search code examples
laravelpermissionsstoragestore

Laravel store files with permissions 774


Im loosing mind. I upload files via laravel API, they are stored in folder and file always get permission 644, is there any way how to store files as 775 ?

can i somehow add this to my function ?

 (0755, true, true)

function for store files:

 $result=$request->file('file_path')->store('apiFiles/'.$idParameter);

thanks for any help


Solution

  • you can change permission of file after creating them by chmod command like this:

    $result=$request->file('file_path')->store('apiFiles/'.$idParameter);
    chmod('file path',0775);