Uploading file to google drive

luxhodge 05 May, 2016
Has anyone tried to upload a file with a form and copy that file directly to google drive? Can anyone point me in the correct direction? Should I custom code and use cURL and PHP or should I use a python script? Do you think I should upload the file using the standard form upload element and then invoke the python or php after the upload is successful? Any thoughts would be appreciated.

Thank you!
luxhodge 05 May, 2016
I am going with a python script. Has anyone called a python script from a custom code action? Is that possible?

Thanks.
GreyHead 06 May, 2016
Hi luxhodge,

I have no idea about doing this with Python, I'd probably use the Google PHP API library - see an example here

Bob
luxhodge 06 May, 2016
Thanks Bob!

I will give that a try and report back.

Python will be my last ditch effort type solution.

Erik
luxhodge 06 May, 2016
Bob,

I read through the documentation at the link you sent: https://developers.google.com/api-client-library/php/guide/media_upload#simple-upload. It seems pretty straight forward, but when I try to implement the code, I get a server 403 error (access error). It seems to be choking on the call to this: Google_Service_Drive_DriveFile(). I am not sure where to go from here. I guess I have to figure out how to get this installed on my webserver. Any thoughts?

Thanks,

Erik
GreyHead 06 May, 2016
Hi Erik,

Yes, you need to install the Google API library on your site. I've included it in my updated GSheet Save [GH] action and save it in /components/com_chronoforms5/extras/Google but you can get a copy from the Google site.

Bob
luxhodge 06 May, 2016
Ok. I see. Thank you again Bob! I feel like this has a chance of working. I will give it a try and see how it goes.

I appreciate the help.

Erik
This topic is locked and no more replies can be posted.