Skip to content

Storing user file & onedrive Google drive etc

Cdhaldane edited this page Jul 21, 2021 · 1 revision

Storing user files

  • Same approach as saving images in which we save the actual file to client and save the path to the database.
  • This improves database speed as saving files there would overcrowd it.

    Implementation

    • On file select we use axios to post it and save it to a folder directory.
    • When the user clicks download we do a window confirm, then does a get and uses straight HTML to download the file.
    • As load times can vary I'll implement a popup loading bar to have a visual representation when the download has been completed.

External storage

  • Google drive, onedrive, etc all use APIs and authentication to allow saving.
  • We need to set up accounts with each cloud provider.
  • AUTH0 (current login service) has ways to work with each popular cloud provider seamlessly to provide authentication.
  • Using a token given from the authentication we can upload the files in whatever format to Google Drive (for example) through an API
  • There's plenty of documentation on how to set up the upload APIS.

https://medium.com/@willikay11/how-to-link-your-react-application-with-google-drive-api-v3-list-and-search-files-2e4e036291b7 https://arnabsen.rocks/posts/upload_using_google_drive_api/

Clone this wiki locally