Spatie/Laravel-medialibrary无法从Backblaze存储中检索文件:此驱动程序不支持检索URL [英] Spatie/Laravel-medialibrary can't retrieven file from Backblaze Storage: This driver does not support retrieving URLs

查看:285
本文介绍了Spatie/Laravel-medialibrary无法从Backblaze存储中检索文件:此驱动程序不支持检索URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在laravel 7.6项目上使用 spatie/laravel-medialibrary:8.2 包.

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

我要使用 Backblaze Cloud Storage将媒体数据存储在

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

我如下制作了名为media的文件驱动程序,并在media-library.php中将其用作文件驱动程序.

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

媒体库软件包不支持B2存储吗?

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

如果是这样,那么我认为可以很容易地使自定义url获得功能.

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

B2存储桶信息,文件目录和文件名存储在媒体库表中.

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

文件位置如下.

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

有人可以帮助我提供良好的解决方案吗?

Can anyone help me with good solution?

谢谢

推荐答案

Backblaze B2 Cloud Storage现在具有与S3兼容的API

Backblaze B2 Cloud Storage Now Has S3 Compatible APIs

您也可以将AWS S3驱动程序用于Backblaze. 他们于2020年5月4日发布了S3兼容API.

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.

借助新的Backblaze S3兼容API,B2云存储现在变得更多 比以往任何时候都易于访问.您现在可以自带(自备) 集成),如果它支持S3 API,则一切就绪!

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!

您需要三件事情才能将您的集成与 Backblaze S3兼容的API:

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

  • S3端点
  • 应用程序密钥
  • 应用程序密钥ID
  • S3 Endpoint
  • Application Key
  • Application Key ID

这将为您提供帮助.

https://help.backblaze.com/hc/zh-CN/articles/360047425453

这篇关于Spatie/Laravel-medialibrary无法从Backblaze存储中检索文件:此驱动程序不支持检索URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆