building-envelope-data / database

Reference implementation of a product data server as part of the product data network buildingenvelopedata.org
MIT License
0 stars 0 forks source link

Uploading and storing files #1

Open simon-wacker opened 3 years ago

simon-wacker commented 3 years ago

Use Presigned Upload URLs as suggested by HotChocolate (and Apollo Server File Upload Best Practices). Maybe we'll need a message broker like RabbitMQ. My old thoughts on this can be read about below.


See https://gitlab.itc-engineering.com/scope/dbe-data-schema-for-building-envelopes/-/issues/30#note_261064 and https://gitlab.itc-engineering.com/scope/dbe-data-schema-for-building-envelopes/-/issues/31#note_261057

Possible protocols are v* Five Secure File Transfer Alternatives to FTP: The contenders are SFTP, FTPS, AS2, HTTPS, and MFT.

For ease of use, I would prefer HTTPS with media type multipart/form-data to upload files (this is what plain old HTML forms with file input use; see also How Does HTTP file upload work?). Ideally, the upload would be done in GraphQL with the GraphQL multipart request specification which has not yet been implemented in HotChocolate been implemented in HotChocolate by now and can be read about on Upload Scalar.

The Apollo Server File Upload Best Practices say that for proof-of-concept implementations multipart/form-data is best (it comes with security problems though as mentioned in the same article at the very top), for production signed URL uploads are to be preferred, and for maximum control a custom file upload/serving system.

Walk-through on how to upload files in ASP.NET Core with security considerations through HTML forms.