Storing static files on google drive in my rails app
In my rails app, I need to store my static assets (JS, CSS, images and downloads) on a storage service like S3, but I can not use S3 at the moment so I have searched and found google drive to be a good service.
Consider that in my app user can upload products and other user and pay then download the products.
You can use Google Drive for the storage of your static site files, although (I do not believe) Drive as a service has the same SLAs as Google Cloud Storage.
Google Cloud Storage is going to give you better SLAs and the expiring download links you are looking for (Cloud Storage Signed URLs).
To try and accomplish something similar in Drive, you would have to require each user to have a Google account, and programmatically set and revoke access, the only other access option is to make the share link available to everyone that has the link. (You might be able to circumvent this by copying the file around each time, but that would be ugly, and cumbersome).
You can use google drive through the google API.
We reserve a login through our apps account to act as the system and then share the requisite folders with that account.
That way you can then upload, download and pick up the files through the drive API using its account, without having to log in as different accounts each time.
I used the google_drive gem rather than the google one due to the hideousness of the security implementation.
Worth noting that the google drive gem now uses the google security implementation (since google shut off access by its previous method). You then have two options: a) Use a single account as described above. b) Set up service account access.
Either should give you what you need.
链接地址: http://www.djcxy.com/p/79884.html