Download File
Prerequisite Permissions: For Download File from OneDrive the following Microsoft Graph permissions are required.
Permission type | Permission (from least to most privileged) |
---|---|
Delegated (work or school account) | Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All |
Delegated (personal Microsoft account) | Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All |
Description
One Drive: Download File step downloads a file from OneDrive.
Note: Support is provided for the Personal Drive, however, the displayed error message is not correct.
Reference:
-
For Download File from OneDrive refer document. https://docs.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http
-
For File conversion refer Microsoft documentation. https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get_content_format?view=odsp-graph-online
Configurations
No. | Field Name | Description |
---|---|---|
Configuration: | ||
1 | Step Name | Name of the step. This name has to be unique in a single workflow. |
Connection: | ||
2 | Client ID | Select the client ID for which you want to copy a file or folder. Note: This field is mandatory for personal accounts. |
3 | Checkbox: Accept value as variable/static | Leave checkbox unchecked to accept Refresh Token value from a field in the previous steps of the stream using a drop down list. Else enable checkbox for Refresh Token field to appear as Text box. |
4 | Refresh Token | Specify the Refresh Token provided by authorization grant flow. The data type is String. This field is mandatory. |
5 | Button: Test Connection | Verifies whether the connection is established or not. |
Input Tab | ||
Input Fields: | ||
1 | OneDrive File ID/Path | Provide OneDrive file ID or path to download file. The field data type is String. This is mandatory. Simply specify filename if it is to be downloaded from root (i.e. Documents/). Else to download a file in any other path - Get OneDrive Path/ID– • You can use the ‘Upload File’ step to get Folder/File ID as an output of step execution. e.g. If OneDrive path is - https://organization-my.sharepoint.com/personal/xyz/Documents/demofolder/File.xlsx. Then, provide – • Documents/demofolder/File.xlsx or • demofolder/File.xlsx |
2 | Output Folder Path | Specify the folder to store the downloaded file. The field data type is String. This is mandatory. |
3 | Browse | On click of this button brings up the dialog to select the output folder path. |
4 | Convert In Format | Specify the format in which the file is to be downloaded. The field data type is String. For Supported file conversions refer URL mentioned in References. Note: There are many supported file formats mentioned in Microsoft documentation. The following formats have been tested with expected results. Supported source extensions for 'pdf' doc, docx, epub, eml, htm, html, md, msg, odp, ods, odt, pps, ppsx, ppt, pptx, rtf, tif, tiff, xls, xlsm, xlsx. Supported source extensions for 'jpg' bmp, jpeg, jpg, png. Supported source extensions for 'html' eml, md, msg. |
5 | Delete Output Folder Contents Before Downloading | Specify from the allowed values: Yes/No. The field data type is String. This is mandatory. |
6 | Add DateTimeStamp For Duplicate File | Specify from the allowed values: Yes/No. The field data type is String. This is mandatory. |
7 | Add File To Result | Specify from the allowed values: Yes/No. Specify Yes to make the file available for download on AutomationEdge server (through Requests menu) after workflow execution. The field data type is String. This is mandatory. |
8 | Width | Provide the width of output JPG image (JPG width). This field is mandatory for conversion to jpg. The field data type is String. |
9 | Height | Provide the height of output JPG image (JPG height). This field is mandatory for conversion to jpg. The field data type is String. |
Output Field: | ||
1 | File Overwritten? | Provide output field name to hold the value for file overwritten (Yes/No). Default is ‘FileOverwritten’. The field data type is String. |