Skip to content

403 error uploading file on seafile server 8.0.x #18

@lukali1986

Description

@lukali1986

Recently, our seafile server was upgraded from 6.0 to 8.0, It is found that the original upload interface cannot be used, 403 error occurred.

I checked the official API interface, It is found that the path parameter is not passed during get upload link.
So I modified the source code

GetUploadLinkRequest.cs

        public string ParentDir { get; set; }

        public override string CommandUri
        {
            get { return $"api2/repos/{LibraryId}/upload-link/?p={ParentDir}"; }
        }

        public GetUploadLinkRequest(string authToken, string libraryId, string parentDir = "/")
            : base(authToken)
        {
            LibraryId = libraryId;
            ParentDir = parentDir;
        }

SeafSession.cs

        var req = new GetUploadLinkRequest(AuthToken, libraryId, targetDirectory);
        var uploadLink = await _webConnection.SendRequestAsync(ServerUri, req);

After this modification, I can upload it.
Please fix this bug. In addition, with the upgrade of seafile, some APIs will be often used, such as share links.
https://download.seafile.com/published/web-api/v2.1/share-links.md

I'm happy to contribute this part of the code, but I don't know how to pull request.
Look forward to your reply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions