Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

  1. I like to know that is there any problem for using google drive for these purposes?
  2. Should I use google storage over google drive?
  3. Does google drive provide secure and auto expire downloads link like S3?
like image 612
user3631047 Avatar asked Jun 15 '14 03:06

user3631047


1 Answers

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.

like image 76
Carpela Avatar answered Oct 01 '22 13:10

Carpela