Saving static files to Google Drive in my rails application

In my rails application, I need to store my static assets (JS, CSS, images and downloads) in a storage service like S3, but I can't use S3 at the moment, so I searched and found that Google was a good service.

Please note that in my application, a user can download products and other users and pay, and then download products.

  • I like to know if there are any problems using Google Drive for these purposes?
  • Should I use google storage on google drive?
  • Does Google Drive provide a safe and automatically expiring download link, such as S3?
+7
google-cloud-storage google-drive-sdk storage
source share
2 answers

You can use Google Drive to store your static site files, though (I don't believe). Drive because the service has the same SLAs as Google Cloud Storage.

Google Cloud Storage will provide you with the best SLAs and expiring download links that you are looking for ( Signed Cloud Storage URLs ).

To try to do something similar in Drive, you will need to require that each user have a Google account and programmatically set and revoke access, the only option available is to make the link accessible for everyone who has the link, (Maybe you can get around this by copying the file every time, but that would be ugly and cumbersome).

+2
source share

You can use the Google Drive through the Google API.

We reserve the login through our application account in order to act as a system and then share the necessary folders with this account.

Thus, you can upload, download and receive files through the drive’s API using your account, without having to log in as different accounts each time.

I used gogle google_drive, not google, due to the disgusting security implementation.


It is worth noting that the pearl google now uses the Google security implementation (since Google has disabled access using the previous method). Then you have two options: a) Use one account as described above. b) Configure access to the service account.

Or you need to give you what you need.

+2
source share

All Articles