How to upload the local file to google drive

Hello guys, Now i am working for upload a local storage file uploaded to google drive from my nodered flow. So when i am inject, then it will activate thr function node and http response node. Function node working for collect the file name and http response node working for login the drive account. But still those not working. Anybody can please tell for correct solution.
Thanks.

If there not a custom node that will do this? Connecting to Google services is generally non-trivial due to their security requirements.

The easier way would be to install a filing system extension for your OS that presents as a virtual folder or mount point (depending on the OS) and lets you treat your Google drive as a filing system. Then you can simply save to it like any other local file.

@TotallyInformation, Thanks for replies and given to new idea, let me try with virtual folder using rclone.

You can use the HTTP Request node to upload a file to Google Forms which will then be saved in Google Drive.

Thanks for reply @PdeJ . Can you explain briefly about answer. Because first i tried with only http response node only. But i can't able to make req from nodred. It shows only error to sent request.
And one more doubt is how to collect a data from local to drive. Previously i used only function node, but those not working properly.

You can create a google form to receive files and share its access so that anyone (with the access code) can upload a file to the form and thence to your Google Drive. Google provides an access code for a shared form which you can use in the HTTP Request node. In this way files can be uploaded to your google drive.

One needs to add a collaborator to the form and generate a responder link.
image

Some references.

I personally use Google forms in this way to send data from Node Red to Google Sheets which is processed curtesy of Google Sheets and then passed back to Node Red for viewing.
https://sites.google.com/view/pdej/ha-pircam/google-sheets

I SHOULD EMPHASIZE THAT I HAVE NOT ATTEMPTED TO SAVE FILES AS SUGGESTED AND SO IT MAY BE POOR ADVICE.

@PdeJ Thanks for explaining breifly. But if i use the google form, then we should only select the file from our local storage and click upload and then only it will go to google drive. But i need, automatically nodered flow get the file from localstorage and upload to drive at daily specific time. Here i need it will works for automatically. Because i already implement stores the data in local storage at specific location. So i want to those files upload to drive at daily.
That purpose, did you have any suggestions?

I'm sorry but I had hoped there was an easy hack to upload files from node red via Google Forms, rather like I use for saving data to Google Sheets, but having spent some time looking at it, it appears to be the case. Maybe using the Google API's will help you. https://flows.nodered.org/flow/a36ccbcfc43c264cda892383fe034fe3

@PdeJ It's ok. You are given solutions are also useful. And if you found the solution about my doubt, please let me know..

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.