input icon indicating copy to clipboard operation
input copied to clipboard

New File Upload Input

Open PhilReinking opened this issue 1 year ago • 4 comments

This PR will add support for file uploads in forms.

File Input Configuration

The input has for now two configurations when added to a block.

  • The number of files allowed per block to upload
  • The total size of the files allowed to upload

I want to somehow limit this here because I think it might be possibly harmful if users can upload files that are too big. Images, PDFs, texts are files that I would consider reasonable enough to accept. But if users want to upload videos or other large files, that should happen with other services that are optimized for these kinds of file sharing.

File Upload Frontend

The file upload can handle one or multiple files at the same time. This mirrors the native behavior of a single file input. A user can select via the file explorer or drop files into the drop area on the form.

CleanShot 2024-02-20 at 18 11 08

Uploads should only happen at the end when the user clicks the Submit button. In that way, possible consents or other inputs are safely captured. If the user cancels submitting the form, no data has been uploaded, therefore no need for cleaning up anything on the server.

To make handling of the uploads easy, my idea is to create a new file upload endpoint, that expects the form session and the block interaction the upload is made from. Each file could be uploaded individually, that allows for better error handling and maybe better performance when uploading.

Handling on server

  • What to expect of the server load?
  • Files should be encrypted before storage?
  • How are files retrieved by other services? (Signed Link? Uploaded files must never be public)
  • How can the user acccess the files?
  • How long are files stored and is there an storage limit?

PhilReinking avatar Feb 20 '24 17:02 PhilReinking

Is this available? Super important feature for our use case.

franciscomfcmaia avatar Mar 11 '24 15:03 franciscomfcmaia

@franciscomfcmaia still a work in progress. If you would like to test it out, I think that a first stable version will be available by end of this week.

PhilReinking avatar Mar 12 '24 09:03 PhilReinking

how is the Status of the File-Upload feature? :) @PhilReinking

Th0rGer avatar Apr 04 '24 20:04 Th0rGer

@Th0rGer almost there, need some further testing and adjustments.

PhilReinking avatar Apr 05 '24 11:04 PhilReinking