This article describes how to upload files to Google Drive using webMethods CloudStreams provider.
User should have a working Google account.
Latest CloudStreams version installed with all the latest fixes.
Latest CloudStreams connector for Google Drive.
- Create a Cloud Connector Service (CCS) for Get Resumable Session (under Files service) in Google Drive.
- Run the CSS by providing valid inputs as shown below. Make sure to provide proper value for X-Upload-Content_Type depending on the file type to be uploaded. > supportsAllDrives parameter must be set to true to upload the file to the Shared drives and enter the shared drive id to the parents’ field.
- Take a note of the Location under the responseHeaders of the output. It contains upload_id that will be required in later steps.
- Create another Cloud Connector Service for Upload File (under Files service) in Google Drive.
- Create an empty flow service, and invoke the pub.file:getFile inside that flow service.
- Drag the CCS created in step 4 inside the flow service. The flow will appear as below.
- Click on the getFile flow and select the pipeline tab. In the Service In section, double click on the fields and provide the required details. filename - The local path of the file that needs to be uploaded. For example, C:\Users\Desktop\abc.pdf loadAs - stream
- Click on the CCS flow (dragged to the flow service in step 6) and select the pipeline tab. Fill in the required details and do the mappings as shown below. upload_id - The same id received from the response in step 3.
- Once all the inputs are specified, run the flow service.
- After successful execution, the file will be uploaded to the Google Drive.