How to read the contents of a downloaded file
When you download any file using Google Drive, Dropbox, or other such applications, it is saved temporarily in the webMethods.io Integration engine local storage. In order to read/access this file, you need to use other online file storage applications where this file can be uploaded. Let’s understand how it works with the help of an example.
Suppose you need to download a file using Google Drive and read it. To do this, follow the steps given below:
Add the Google Drive connector to canvas, connect it to the Start icon, and double-click the connector icon. This will open the configuration window where you can select the action you want to use.
Select Action: For the purpose of this tutorial, select the downloadFileById action from the drop down list. This will populate the below two fields:
Name: Provide a label for the action you want to configure.
Authorize Google Drive: Select the account you want to use to execute the action, from the drop‐down list. If you have not created an account yet, click on the + button. You will see two options:
Default Authorization: Select this option to allow webMethods.io Integration to automatically generate all keys required to execute all Google Drive actions.
Or: Select this option to provide the relevant keys required to execute all Google Drive actions.
Select one of the options, provide the required information as prompted on the screen, and click Add.
This will create a new account for your Google Drive account. Once you create an account, you can use it to execute all other Google Drive actions and triggers.
Once this is done, click Next, test the action, and click Done.
At this stage, if you run the workflow, the specified file will be downloaded to webMethods.io Integration engine local storage. To read/access this file, use Dropbox Download file action (or any other similar action of a cloud storage application).
Add Dropbox connector to canvas, connect it to the Google Drive connector, and double-click the Dropbox connector.
Select the Upload File action, provide a label for action, and add or select the account you want to use to execute the action, just like we did for Google Drive.
Once you have entered all the details, click NEXT, test the action, and click Done.