Google Drive files - change permissions (make public)

37 views
Skip to first unread message

Suraj Mehta

unread,
Apr 26, 2017, 10:50:02 AM4/26/17
to Ruby on Rails: Talk
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.
Reply all
Reply to author
Forward
0 new messages