Laravel upload file report error, ask for help!

1. Using the laravel framework, and then the port is 8088, in the server test upload is normal, but upload on other computers will report an error, prompting insufficient permissions, I posted the code below, please help.

2 Code

Custom in filesystems.php

"upload" => [
            "driver" => "local",
            "root" => public_path("uploads/assets"),
        ],
        

Controller

//
public function asset_picture_upload(Request $request){
    $file = $request->file("picture");
        //
        $ext = $file ->getClientOriginalExtension();
        
        //
        $path = $file -> getRealPath();
        $filename = date("Y-m-d-H-i-s")."-".uniqid().".".$ext;
        //
        $bool = Storage::disk("upload") -> put($filename,file_get_contents($path));
        return $data = ["code"=>0,"data"=>$path];
}

the above is successful in the server test, but errors will be reported in other calculations. Guess whether it is due to the port problem. The screenshot of the error report is as follows:

Mar.10,2022

it seems that you do not have write permission to upload the directory.

The simple thing to do is to make the directory of the uploaded file fully writable.
Windows is generally solved by adding an Everyone account. For more information, please see https://jingyan.baidu.com/art. (this article is from Baidu casually, and it should not be a problem)

.
Menu