nbspou / dospace

Dart client library to interact with the DigitalOcean Spaces API. Same API as Amazon AWS S3.
BSD 3-Clause "New" or "Revised" License
14 stars 48 forks source link

Delegated upload from client app #1

Open kaetemi opened 6 years ago

kaetemi commented 6 years ago

The client app will send to the server the filetype, filesize, and sha256 hash of the file which it needs to upload. In general these files will be images. It may be nice to let the library generate the options, if it proves useful and practical.

After validating the received options, the server will generate the key for the file in the storage bucket, store this key with the user's account in the database, and then use the library to generate the signed HTTP request to upload the data. The request headers and options are then sent to the client app.

Using the pre-signed HTTP request from the server, the client will upload the file, and notify the server when it is finished. The library is used to handle the upload properly with the pre-signed request.

Handling failed or non-uploaded files and other database cleanup is up to the server, and not a concern here.