Skip to content

Conversation

TwoOnefour
Copy link
Contributor

close #1100

@xrgzs xrgzs requested a review from j2rong4cn August 25, 2025 15:54
@TwoOnefour
Copy link
Contributor Author

问题出在分块上传的时候,有些sdk的实现不会传入Content-Length, 导致f.GetSize()返回0

buf = make([]byte, bufSize)

下面的bufSize也就直接变成0了,而这个commit之前是所有cache都直接存入硬盘中,即utils.CreateTempFile,然后file会变成tmpF,之后GetSize()在 http chunk和非http chunk都会获取到正确的文件大小

@@ -4,18 +4,17 @@ import (
"context"
"errors"
"fmt"
"github.com/OpenListTeam/OpenList/v4/internal/conf"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

奇怪,这里为什么会跑上去

@TwoOnefour
Copy link
Contributor Author

原来代码有些地方看着有点跟不上@j2rong4cn的思路,不太会改😢

虽然看起来像爆改,但我已经尽量保留原来的思路了

@j2rong4cn
Copy link
Member

我明天有空再改

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.

[BUG] 流式上传对分段式的支持出现了问题
3 participants