Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with uploading images to Cloudflare R2 关于图片上传到Cloudflare R2 的问题 #2878

Closed
mengxizhuo opened this issue Jan 31, 2024 · 6 comments
Labels
enhancement New feature or request Stale

Comments

@mengxizhuo
Copy link

Describe the solution you'd like

目前经本人测试,选择存储为 Cloudflare R2 ,上传图片会经过服务器中转
这对于一些小带宽的服务器不太友好,请问有什么方法可以解决 直接直连上传到 对象存储
Tips:不知道是不是不支持,还是个人的配置有问题
At present, after my own testing, I chose Cloudflare R2 for storage. Uploaded images will be transferred through the server. This is not very friendly to some servers with small bandwidth. Is there any way to solve the problem of directly uploading to object storage? I don’t know if it is not supported. Or is there something wrong with my personal configuration?

Type of feature

API

Additional context

No response

@mengxizhuo mengxizhuo added the enhancement New feature or request label Jan 31, 2024
@wbchn
Copy link

wbchn commented Feb 1, 2024

我从我的理解来解释下

  1. 从客户端直接上传的方式,AWS S3 Signed url或是阿里云 OSS 支持, R2 也有类似实现 Presigned URLs
  2. memos已经使用了 AWS S3 SDK,如果需要实现,剩下的是功能的实现。
  3. 看代码中已经有了部分实现,可能没有用在前端页面上传。
// RunPreSignLinks is a background job that pre-signs external links stored in the database.
// It uses S3 client to generate presigned URLs and updates the corresponding resources in the store.
func RunPreSignLinks(ctx context.Context, dataStore *store.Store) 

以上是临时查看代码得到的,如有错误请指正。

@wbchn
Copy link

wbchn commented Feb 1, 2024

我从我的理解来解释下

  1. 从客户端直接上传的方式,AWS S3 Signed url或是阿里云 OSS 支持, R2 也有类似实现 Presigned URLs
  2. memos已经使用了 AWS S3 SDK,如果需要实现,剩下的是功能的实现。
  3. 看代码中已经有了部分实现,可能没有用在前端页面上传。
// RunPreSignLinks is a background job that pre-signs external links stored in the database.
// It uses S3 client to generate presigned URLs and updates the corresponding resources in the store.
func RunPreSignLinks(ctx context.Context, dataStore *store.Store) 

以上是临时查看代码得到的,如有错误请指正。

sorry, this is a replicated issue already discussed in #2565, and merged at #2855

@mengxizhuo
Copy link
Author

我从我的理解来解释下

  1. 从客户端直接上传的方式,AWS S3 Signed url或是阿里云 OSS 支持, R2 也有类似实现 Presigned URLs
  2. memos已经使用了 AWS S3 SDK,如果需要实现,剩下的是功能的实现。
  3. 看代码中已经有了部分实现,可能没有用在前端页面上传。
// RunPreSignLinks is a background job that pre-signs external links stored in the database.
// It uses S3 client to generate presigned URLs and updates the corresponding resources in the store.
func RunPreSignLinks(ctx context.Context, dataStore *store.Store) 

以上是临时查看代码得到的,如有错误请指正。

抱歉,这是 #2565 中已经讨论过的重复问题,并在 #2855 中合并

确实已有讨论,刚刚测试了一下,尽管是添加阿里云OSS和腾讯云COS,都还是会经过服务器中转再上传到OSS / COS

望开发者能够加入直传的API功能

@wbchn
Copy link

wbchn commented Feb 1, 2024

docker 部署的么?如果是docker,截止现在是 latest 指向 0.19.0 版本,release at 2024-01-28

#2855 在2024-01-29 fa17dce 合并

等待下个版本,或自行编译再试。

@Issues-translate-bot
Copy link

Issue is not in English. It has been translated automatically.


Is it deployed by docker? If it is docker, as of now, latest points to version 0.19.0, release at 2024-01-28

#2855 Merged in 2024-01-29 fa17dce

Wait for the next version, or compile it yourself and try again.

Copy link

This issue is stale because it has been open 14 days with no activity.

@github-actions github-actions bot added the Stale label Feb 16, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

3 participants