m2sh / laravel-minio-sample

sample project to use Minio as Laravel cloud file system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ASK] Error when trying to upload an image

MrCrap opened this issue · comments

I'm still confused when I want to upload an image to the minio server using laravel, is there a more detailed example?

like the example below:
Storage::disk('minio')->put('avatars/1', $fileContents);

I'm still confused about the parameters $fileContents.

$file = $request->file('file');
$name = uniqid() . '_' . trim($file->getClientOriginalName());

$file->move($path, $name);
$fullpath = $path.'/'.$name;

Storage::disk('minio')->put('news/'.$name, $fullpath);

and I have an error like this:

Error executing \"PutObject\" on \"https://domain.bla/callinknews/news/60de0b57ebdb5_FB_IMG_1512657538119.jpg\"; AWS HTTP error: Client error: `PUT https://domain.bla/callinknews/news/60de0b57ebdb5_FB_IMG_1512657538119.jpg` resulted in a `400 Bad Request`

Have you found the solution?