Spatie/Laravel-medialibrary can't retrieven file from Backblaze Storage: This driver does not support retrieving URLs

会有一股神秘感。 提交于 2020-06-17 02:18:19

问题


I am using spatie/laravel-medialibrary:8.2 package on my laravel 7.6 project.

I am going to store media data on Backblaze Cloud Storage using gliterd/laravel-backblaze-b2 package.

I made file driver called media as following and using it in media-library.php as file driver.

When I uploaded file, it stored on exact directory what I wanted. But when I was going to retrieve it, I got following error.

This driver does not support retrieving URLs

Media-library package doesn't support for B2 storage?

If so, then I think It's possible to make custom url get function easily.

B2 Bucket info, file directory and filename are stored in media library table.

And file location is as following.

https://f000.backblazeb2.com/file/[bucket name]/[file id]/[file name ] 

Can anyone help me with good solution?

Thanks,


回答1:


Backblaze B2 Cloud Storage Now Has S3 Compatible APIs

You can use AWS S3 driver as same for Backblaze too. They released S3 Compatible API on May 4, 2020.

You can get Application Key in your account instead of master application key.

With the new Backblaze S3 Compatible API, B2 Cloud Storage is now more accessible than ever. You now have the ability to BYOI (Bring Your Own Integration), and if it supports the S3 API then you’re all set!

There are three things you need to connect your integration with the Backblaze S3 Compatible API:

  • S3 Endpoint
  • Application Key
  • Application Key ID

This will help you.

https://help.backblaze.com/hc/en-us/articles/360047425453



来源:https://stackoverflow.com/questions/62028837/spatie-laravel-medialibrary-cant-retrieven-file-from-backblaze-storage-this-dr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!