Skip to content

Conversation

@Y-ASLant
Copy link
Contributor

@Y-ASLant Y-ASLant commented Oct 24, 2025

Description / 描述

  • 额外增加直连上传功能(文件不经过部署服务器直接上传OneDrive服务器)
  • 默认为关闭,可在后台管理OneDrive存储下开启,与原有功能共存,不存在冲突

前端:OpenListTeam/OpenList-Frontend#249

PixPin_2025-10-24_16-15-48 PixPin_2025-10-24_16-16-18

Motivation and Context / 背景

  • 文件上传失败问题,部署在服务器上使用,上传的文件需要经过先上传到服务器然后才会上传OneDrive,对于一些配置低(网络)的设备及其容易失败。现在可以选择开启直连OneDrive上传,文件不会经过服务器,服务器只会有请求API的流量,节省服务器资源。

Closes #1246

How Has This Been Tested? / 测试

Checklist / 检查清单

@Y-ASLant Y-ASLant changed the title OneDrive额外增加直连上传方式 OneDrive额外增加直连上传方式,极大提高文件上传成功率 Oct 24, 2025
@KirCute
Copy link
Member

KirCute commented Oct 24, 2025

请在前端仓库也发起pr,并在此pr中附上前端pr的跳转链接

@Y-ASLant
Copy link
Contributor Author

请在前端仓库也发起pr,并在此pr中附上前端pr的跳转链接

稍等,

@KirCute
Copy link
Member

KirCute commented Oct 24, 2025

不是很喜欢目前这种实现方式,如果真的要做前端上传,s3等驱动也会有相关需求,建议考虑将“获取前端上传信息“函数设计为一个驱动实现的接口,驱动未实现接口或调用返回errs.NotImplement表示驱动不支持(未启用)前端上传

@Y-ASLant
Copy link
Contributor Author

不是很喜欢目前这种实现方式,如果真的要做前端上传,s3等驱动也会有相关需求,建议考虑将“获取前端上传信息“函数设计为一个驱动实现的接口,驱动未实现接口或调用返回errs.NotImplement表示驱动不支持(未启用)前端上传

确实不错,我重新规划一下。是我考虑不全面了

@KirCute
Copy link
Member

KirCute commented Oct 24, 2025

建议取消/check_direct_upload接口,可以通过/get_direct_upload_info的返回值判断是否进行前端直连上传,减少一次API调用

@KirCute KirCute changed the title OneDrive额外增加直连上传方式,极大提高文件上传成功率 feat(onedrive): support frontend direct upload Oct 24, 2025
@KirCute KirCute marked this pull request as draft October 27, 2025 05:53
@Y-ASLant
Copy link
Contributor Author

建议取消/check_direct_upload接口,可以通过/get_direct_upload_info的返回值判断是否进行前端直连上传,减少一次API调用

这边部署在自己服务器上跑了几天了,没有任何问题。我还需要有什么补充的地方吗

@KirCute
Copy link
Member

KirCute commented Nov 2, 2025

这边部署在自己服务器上跑了几天了,没有任何问题。我还需要有什么补充的地方吗

最近有点忙,可能得过两天才能看看

KirCute
KirCute previously approved these changes Nov 3, 2025
jyxjjj
jyxjjj previously approved these changes Nov 5, 2025
@KirCute
Copy link
Member

KirCute commented Nov 5, 2025

这个上传逻辑适不适用于onedrive_app?要不给onedrive_app也加上

@KirCute KirCute dismissed stale reviews from jyxjjj and themself via 7a4d520 November 6, 2025 13:10
@KirCute
Copy link
Member

KirCute commented Nov 6, 2025

@ILoveScratch2 日志改了,你再看一下,没问题就合吧

@KirCute KirCute merged commit 39dcf9b into OpenListTeam:main Nov 6, 2025
handazao pushed a commit to handazao/OpenList that referenced this pull request Nov 7, 2025
* OneDrive添加直连上传

* refactor

* fix: duplicate root path join

---------

Co-authored-by: KirCute <951206789@qq.com>
@w0ngzz
Copy link

w0ngzz commented Nov 11, 2025

image 直连上传不显示上传网速

@Y-ASLant
Copy link
Contributor Author

image 直连上传不显示上传网速

PixPin_2025-11-11_13-05-49 不显示这种吗?开启直连了吗,直连需要选择Direct

@w0ngzz
Copy link

w0ngzz commented Nov 11, 2025

image 直连上传不显示上传网速

PixPin_2025-11-11_13-05-49 不显示这种吗?开启直连了吗,直连需要选择Direct

image image

上传时选了direct的,存储设置也勾选了direct

@Y-ASLant
Copy link
Contributor Author

image 直连上传不显示上传网速

PixPin_2025-11-11_13-05-49 不显示这种吗?开启直连了吗,直连需要选择Direct

image image
上传时选了direct的,存储设置也勾选了direct

开着代理上传试试呢

@w0ngzz
Copy link

w0ngzz commented Nov 11, 2025

image 直连上传不显示上传网速

PixPin_2025-11-11_13-05-49 不显示这种吗?开启直连了吗,直连需要选择Direct

image image
上传时选了direct的,存储设置也勾选了direct

开着代理上传试试呢

image

选择stream上传可以正常显示

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 支持预签名上传 URL 直连云盘以绕过自建服务器,降低上传失败率

5 participants