vendredi 8 mai 2020

Uploading media file on Digitalocean Storage error with PHP Laravel

As I am getting the below error while uploading the media file on DO Storage via s3 driver with php laravel. Please let me know where we are getting the issue in the code so that error is generating.

"Error executing "PutObject" on "https://pieoramaspace.s3.nyc3.amazonaws.com/uploads/images/download%20%286%29.jpeg"; AWS HTTP error: cURL error 6: Could not resolve host: pieoramaspace.s3.nyc3.amazonaws.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

I have tried 2 types of code to upload media ie below Type 1.

 $extension =  $request->file('profile_image')->extension();
 $path = Storage::disk('do_spaces')->putFileAs("uploads", $request->file('profile_image'), time().'.'.$extension);

Type 2.

$file = $request->file('profile_image');
$name = $file->getClientOriginalName();
$store = Storage::disk('do_spaces')->put('/uploads/images/'.$name, file_get_contents($request->file('profile_image')->getRealPath()), 'public');

I got the same above error.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire