Skip to content

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

Open

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

  1. github-actions commented on Dec 8, 2025

    @github-actions

    感谢您联系OpenList。我们会尽快回复您。
    Thanks for contacting OpenList. We will reply to you as soon as possible.

  2. jyxjjj commented on Dec 8, 2025

    @jyxjjj
    Member

    这是一个文档问题,因ApiFox不支持外部PR,转移到此处并等待其他开发者修复。

  3. tksonix commented on Dec 8, 2025

    @tksonix
    Author

    这是一个文档问题,因ApiFox不支持外部PR,转移到此处并等待其他开发者修复。

    那么请问正确的请求应该是什么样呢,我应该根据哪里的信息来确定我怎么写请求?

  4. jyxjjj commented on Dec 8, 2025

    @jyxjjj
    Member

    这是一个文档问题,因ApiFox不支持外部PR,转移到此处并等待其他开发者修复。

    那么请问正确的请求应该是什么样呢,我应该根据哪里的信息来确定我怎么写请求?

    https://github.com/OpenListTeam/OpenList/blob/main/server/handles/fsup.go#L48

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