Skip to content

[BUG] 在使用OpenList API upload file(stream)进行上传时,path失效,并直接将根目录替换为上传的文件 #254

Description

@tksonix

Please confirm the following

  • I have read and agree to AGPL-3.0 Section 15 .
    The program is provided "as is" without any warranties; you bear all risks of using it.

  • I have read and agree to AGPL-3.0 Section 16 .
    The copyright holders and distributors are not liable for any damages resulting from the use or inability to use the program.

  • I confirm my description is clear, polite, helps developers quickly locate the issue, and complies with community rules.

  • I have read the OpenList documentation.

  • I confirm there are no duplicate issues or discussions.

  • I confirm this is an OpenList issue, not caused by other reasons (such as network, dependencies, or operation).

  • I believe this issue must be handled by OpenList and not by a third party.

  • I confirm this issue is not fixed in the latest version.

OpenList Version (required)

4.1.4

Storage Driver Used (required)

Aliyun

Bug Description (required)

在使用OpenList API upload file(stream)进行上传时,path失效,并直接将根用户目录替换为上传的文件。
具体python代码:

def _conn_upload_file(self, path: str, payload: bytes, modified: str):
    print(path, modified)
    wait_for_confirmation()
    self.conn.request("PUT", "/api/fs/put", payload, {
        'path': path,
        'As-Task': 'true',
        'Last-Modified': modified,
        'Authorization': self._jwt(),
        'Content-Type': 'application/octet-stream'
    })
    res = self.conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))

参数取值和response看下方log打印

Logs (required)

Image Image Image

Configuration File Content (required)

Image Image

Reproduction Link (optional)

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIAPI文档bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions