Search code examples
javascriptphphtmlgoogle-apps-scriptserver-side-scripting

Accessing Google Drive Files On The Server Side Of A Website


So I'm making a website. I need to submit a form to a server to be processed. This is required to process login information. This server-side script needs to access a plain-text file which is stored on my Google Drive in order to confirm that the user input is valid. The only way that I know how to access a file on Google Drive is through Google Apps Script.

Is there a way to handle forms on the server-side that are submitted from another website with HTML or JavaScript in Google Apps Script? or Is there a way to use PHP with Google Apps Script? or Is there another more efficient way that I can access and write to files on my Google Drive directly from my website?


Solution

  • You can make an HTTP request to an Apps Script and get a response back. Take a look at the Content Service. Google also has a PHP Client API that you can use. You would need to use the Drive Service.