alist icon indicating copy to clipboard operation
alist copied to clipboard

蓝奏云优享版小文件上传失败

Open houruomu opened this issue 1 year ago • 2 comments

Please make sure of the following things

  • [X] I have read the documentation. 我已经阅读了文档

  • [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 ,Dependencies or Operational). 我确定是AList的问题,而不是其他原因(例如网络依赖操作)。

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

AList Version / AList 版本

v3.37.4

Driver used / 使用的存储驱动

蓝奏云优享版

Describe the bug / 问题描述

小于1.3KB的小文件以及空文件无法上传。 使用rclone挂载webdav上传会提示Failed to copy: Method Not Allowed: 405 Method Not Allowed 而使用web界面上传会提示_“-1: 未读取到文件大小”_

Reproduction / 复现链接

上传问题,无法提供链接。

Config / 配置

image

Logs / 日志

image image

houruomu avatar Sep 23 '24 06:09 houruomu

Thanks for opening your first issue here! Be sure to follow the issue template!

welcome[bot] avatar Sep 23 '24 06:09 welcome[bot]

问题仍然存在

houruomu avatar Oct 03 '24 02:10 houruomu

可以复现,上传小于1KB的文件时,会报错: image

Jason-Fly avatar Oct 20 '24 13:10 Jason-Fly

已定位到问题,在通过/7n/getUpToken接口获取token时,如果传参中的fileSize0,则会报错。 image

Jason-Fly avatar Oct 20 '24 13:10 Jason-Fly

调研了蓝奏云优享版的/7n/getUpToken接口,发现他们在将字节数转为KB数时是向上取整的,所以改成向上取整应该可以解决。 image

image

Jason-Fly avatar Oct 20 '24 14:10 Jason-Fly

Hi, 我看到您向上取整的方法是直接+1,请问这样会不会在文件大小是1024字节整数倍的情况下出现问题?

houruomu avatar Oct 21 '24 01:10 houruomu

是否使用max(1,(x+1023)/1024)更保险?

houruomu avatar Oct 21 '24 01:10 houruomu

Hi, 我看到您向上取整的方法是直接+1,请问这样会不会在文件大小是1024字节整数倍的情况下出现问题?

感谢指出,您的方案会更严谨; 我尝试生成整数倍的文件进行上传,目前不会产生问题,后续可以进行优化。 image

Jason-Fly avatar Oct 21 '24 06:10 Jason-Fly