AlistGo / AlistGo/alist

API流式上传丢数据

未关闭
#7,137 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Go
星标
50.2k
派生
7.9k
平均合并
7 天 21 小时
30 天内合并 PR
6

描述

### Please make sure of the following things

- [X] I have read the [documentation](https://alist.nn.ci).
我已经阅读了[文档](https://alist.nn.ci)。

- [X] I'm sure there are no duplicate issues or discussions.
我确定没有重复的issue或讨论。

- [X] I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
我确定是`AList`的问题,而不是其他原因(例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host),`依赖`或`操作`)。

- [X] I'm sure this issue is not fixed in the latest version.
我确定这个问题在最新版本中没有被修复。

### AList Version / AList 版本

v3.3

### Driver used / 使用的存储驱动

Crypt

### Describe the bug / 问题描述

采用流式API上传/api/fs/put,Content-Length取的文件size,但是上传后,图像数据时丢失的,见图2.
![image](https://github.com/user-attachments/assets/d0eab331-6153-4998-8c67-795f57dd65e7)
![image](https://github.com/user-attachments/assets/1ffd4fd1-a09f-4edb-aca7-0c5a9da85458)

### Reproduction / 复现链接

请看上面截图

### Config / 配置

![image](https://github.com/user-attachments/assets/96934a2d-2e97-466b-ab0d-2ca8f2c91e97)

### Logs / 日志

unexpected EOF; CreateTempFile failed
failed to create temp file
github.com/alist-org/alist/v3/internal/fs.putAsTask
/source/internal/fs/put.go:47
github.com/alist-org/alist/v3/internal/fs.PutAsTask
/source/internal/fs/fs.go:105
github.com/alist-org/alist/v3/server/handles.FsStream
/source/server/handles/fsup.go:63
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/alist-org/alist/v3/server/middlewares.FsUp
/source/server/middlewares/fsup.go:43
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/alist-org/alist/v3/server/middlewares.Auth
/source/server/middlewares/auth.go:73
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
/source/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.LoggerWithConfig.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620
github.com/gin-gonic/gin.(*Engine).ServeHTTP
/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576
net/http.serverHandler.ServeHTTP
/usr/local/go/src/net/http/server.go:2938
net/http.(*conn).serve
/usr/local/go/src/net/http/server.go:2009
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1650

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。