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

fix(terabox): big file upload issue #7498

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

Jason-Fly
Copy link
Contributor

@Jason-Fly Jason-Fly commented Nov 13, 2024

修复问题

#7490

问题原因

  1. /api/create接口报错,返回了errnoerrmsg,但alist没有对errno做判断,导致页面上误显示为上传成功;
  2. 根据返回的errno: 10errmsg: "create super file failed.",无法定位到问题,所以需查看官方接口参数;
  3. 根据对Terabox抓包分析,在上传超过8GB的文件时,chunk大小为16MB,而alist的逻辑用的是4MB,可能因为chunk太多导致在最终的/api/create接口中上传失败;
  4. Terabox还更新了/api/precreate接口的入参字段。

修复方案

  1. Terabox做了多次抓包分析,发现chunk的大小会按如下规则动态调整:
文件大小 chunk
(0GB, 4GB] 4MB
(4GB, 8GB] 8MB
(8GB, 16GB] 16MB
(16GB, 32GB] 32MB
(32GB, 64GB] 64MB
(64GB, 128GB] 128MB
  1. /api/precreate接口中,请求体有如下变化:
Snipaste_2024-11-13_22-28-53

其中block_list是固定值,用多个账号测试发现都是这个值,不再需要在这个阶段计算chunksmd5了。
3. 额外修正了local_mtime字段的值,改成本地文件的mtime,不应该传当前时间戳。

自测结果

  1. 9GB大文件上传成功;
Snipaste_2024-11-13_18-03-33 Snipaste_2024-11-13_18-07-05
  1. 以下文件均上传成功。
    Snipaste_2024-11-13_23-22-42
Snipaste_2024-11-13_23-25-22

@xhofe xhofe merged commit 6c38c59 into AlistGo:main Nov 16, 2024
3 checks passed
xrgzs pushed a commit to xrgzs/alist that referenced this pull request Nov 16, 2024
long2005a1 added a commit to long2005a1/Long-Cloud that referenced this pull request Nov 19, 2024
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.

2 participants