Ruby on Rails Wednesday, April 26, 2017

Hello ,

    I have created a Rails app which allows user to upload files to my Google Drive. 
        session = GoogleDrive::Session.from_config("config.json")
        session.upload_from_file(params[:file].path.to_s, "a_desired_file_name",convert: false)

    I want to make these uploaded files accessible to all, I want to do it using some Ruby code only. I don't wanna do it manually. 

    My motto to do it is my application has a View which lists the links of the files from Google Drive, and those links are useless unless they are 'shareable links.' .

I have used the following gems.
    gem 'google_drive'
    gem 'google-api-client'

'create_permission' method is a listed solution for this problem, but unfortunately it only works with Team Drive which comes with G-Suit.

I hope for your kind assistance.

Thanks 
Suraj

it is made mandatory for me to use Google Drive for this purpose.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b57e4551-cf2a-46a2-89fb-b73192486447%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment