Skip to content

Direct upload via public API with hidden share (Alternative 1 of 2) #35260

Open
@Kharonus

Description

@Kharonus

As a developer integrating a Web application with Nextcloud
I want to offer direct file uploads to specific folders in Nextcloud right from my application's frontend
so that I don't need to use my backend as a proxy and save resources (connections, band-width, ...)

Alternative to: #35262

Description

  • It has a similar workflow like the direct download feature.
    • From any authorized instance (e.g. backend server with OAuth 2 connection to NC) fetch a token or URL.
      • create a share on the folder that only allows uploading
      • the share is hidden from the Nextcloud frontend
      • the share has a default expiration date (configurable)
      • allows sharing the root folder of the user (currently creating shares on root folders is not allowed)
    • Give that to another, not authorized client (e.g. some frontend application running in a browser).
    • Execute upload from that client:
      • e.g. pick a file from within the browser's file picker
      • put file blob as raw data in request body
      • send request to given URL containing shared token

Requirements

  • There is a private endpoint that can get requested to provide an upload URL of any file to a specific location as a authenticated user.
  • There is a public endpoint behind the provided upload URL, that can get requested without authorization header.
  • The upload URL must expire per default.
  • The upload URL must not allow the user to change the upload location nor the uploading user id.

Known advantages over alternative #35262

  • close to existing public shares functionality
  • no exposure of any user credentials to unauthorized clients

Known disadvantages regarding alternative #35262

  • Currently the public API does not support chunked uploads, which limits the file size by any means (i.e. request body size limit, web server timeout, reverse proxy body size limits, ...)

for the attention of

@julien-nc
@PVince81

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions