Google Drive

Google Drive

by scottrules44

View and activate on the Corona Store

This plugins integrates Google Drive™, a places to store and manage files.



Google cloud save has been added to this plugin. The demo, docs, and plugin have been updated. To check if you are running this version please use print(drive.version) – should be 2.0 if you are using lastest version

This plugin let app users access their OWN (previously created) Google Drive account, or let app users access only to MY (app developer) account?


The user has to have a google account and the data is stored in a private section of Google drive.

I had a problem compiling example, because simulator didn’t find modules googleDrive, etc. Logged to “Plugins” directory, extracted zip plugin file, moved all file extracted from “/Plugins/plugin” to “/Plugins” and now example can start without problems.

That is odd

That is my fault, Let me do a quick update

This was just pushed, give it an hour and it should be working


print (drive.version) —> 2.0


In main.lua —> local drive = require(“plugin.googleDrive”)

This validates Google user and redirects. No problem now.

Sorry, me again…

I can in fact upload a .zip file, (i.e., about 10 Mbyte). The source file in device is tested OK. The uploaded file to Drive looks like a corrupted file. Should I change the MIME type in request or any other feature? Thanks.

Are you uploading to app folder or just main drive

Just main drive.

Try setting mimeType to application/zip

No success. I will keep on trying later. I think file has been base-64 encoded, and embedded into a plain (application/json???) file…

I’ll post if i am able to get it.

By the way, this is content of uploaded file:


Content-Type: application/json; charset=UTF-8"



Content-Type: application/json; charset=UTF-8"



content-disposition: form-data; name=“prueba”; filename=“”

Content-Type: application/zip

Content-Transfer-Encoding: base64



(here continues all base-64 encoded zip file)

I’ll take a look when I get to my computer

I just did a working test


local fileName = "" drive.request("", "POST", function ( e ) print(e.response) end, {uploadType= "multipart"}, {name = fileName}, fileName, system.ResourceDirectory, "application/zip", fileName )

Windows support added for web view added in the recent daily builds.

Dear Scott,

I think this is the correct place to speak about this plugging and possible bugs.

1st. Will this plug support the new policies for Google for the next April 20th ?


The rollout schedule for the deprecation of web-views for OAuth requests to Google is as follows. Starting  October 20, 2016 , we will prevent new OAuth clients from using web-views on platforms with a viable alternative, and will phase in user-facing notices for existing OAuth clients. On  April 20, 2017,  we will start blocking OAuth requests using web-views for all OAuth clients on platforms where viable alternatives exist.

  1. All names for the files uploaded to the application folder lost his own name, and change to ‘Untitled’. This make impossible to get the correct ID for the file we need to download.




drive.request(“”, “GET”, function ( e ) 


end, {spaces= “appDataFolder”} )



GIVES THIS ANSWER (I have uploaded 2 files)




 “kind”: “drive#fileList”,

 “files”: [


   “kind”: “drive#file”,

   “id”: “1gi4QMQ12wZkI1wMcBic1OgM8cHLpZhqk37-2ZLhVn-KO”,

   “name”: “Untitled”,

   “mimeType”: “application/octet-stream”



   “kind”: “drive#file”,

   “id”: “11uoK3859IMBFeYtRp4SgixXrOe7klttXXudpbwfX0_6X”,

   “name”: “Untitled”,

   “mimeType”: “application/octet-stream”






Note that the name is ‘Untitled’ for both files. Not possible to identify the correct file to download.


I think this is a bug dear.



  1. Is there any way to create folders to upload files to?

Google explain that need to change the mimeType to

mimeType = “application/”


But I have been testing and the mime type always is the same. Any way to create folders by this way or other?




Thanks again for your great job.



A lot of stuff there

let me try to break it down

  1. I not received anything on mac simulator, I am looking into this. I think iOS is the major problem. I will try to implement slowly as time goes along. 

as for the other stuff I just want to address that way plugin is, it is designed to allow access to the drive rest api. So this “bug” is not with plugin self, it is the way it’s used. It like making the comparison that the network api are broken because I am getting server errors. It could be networking apis, but it is mostly likely the way its being used or the server.

 I have been trying myself and I cannot get it working. I honestly know just as much as you do about every google drive api. I feel this google bug based on the way google drive documentation is written.