g4gdrv_downloadFile

*//////////////////////////////////////////////////////////////*

* g4gdrv_downloadFile - Download File *

* *

* Output: *

* out_errMsg - The error message (if error exists). *

* *

* Returns: *

* -1 for error, 0 for success *

* *

* Settable Variables ([r]=required) *

* id - Google ID [r] *

* file_id - The Google File ID of the file to download *

* in_drive_id - The ID of the shared drive to download from. *

* Leave blank to specify your personal drive. *

* in_drive_name - The name of the shared drive to download *

* from. If drive id and drive name are specified, the *

* drive name will be ignored. *

* in_parent_id - The ID of the parent folder of the file. *

* download_folder - The name of the folder to download a *

* file from. If file_id is specified this value is *

* ignored. *

* download_file - The name of the file to download. If *

* file_id is specified this value is ignored. *

* search_type - The type of object to earch for. Valid *

* values are "drive", "folder" and "file" or any value *

* from the G4GCTTPF file. *

* convert_file - Specify *YES to convert the file when *

* downloaded. *

* mime_type - If converting the file while downloading, *

* specify the mime type of the resulting file. *

* download_to_directory - The directory to place the *

* downloaded file into. [r] *

* download_to_filename - The name of the file to download *

* the file to. [r] (*DFT) *

* replace_file - Whether or not to replace the file if it *

* already exists (*YES, *NO) *

* ccsid - The CCSID to use (1252) *

* debug - Turn on Debug (*NO, *YES) *

* debug_file - The debug file name. *

* (/tmp/g4g_[id]_moveFile.txt) *

* *

*//////////////////////////////////////////////////////////////*

D g4gdrv_downloadFile...

D PR 10i 0

D out_errMsg 256 Options(*NOPASS)

g4gdrv_downloadFile will download a file from your Google Drive Account.

Returns: 1 for successful upload, -1 for error.

Optional Parameters:

  • Error Message (output) - Error message

Settable Variables (use g4gdrv_setValue):

  • id (required) - Your Google ID

  • file_id - The Google File ID of the file you wish to download

  • in_drive_id - Enter the ID of a shared drive, blank for your personal drive.

  • in_drive_name - Enter the name of a shared drive. This will be used to find the ID.

  • in_parent_id - Specify the ID of the folder in which the file resides. This can be used instead of specifying a download folder name.

  • download_folder - The name of the folder to download a file from. If file_id is specified this field is ignored.

  • download_file - The name of the file to download. If file_id is specified this field is ignored.

  • search_type - Specify the search type of the file to find. If left blank this defaults to "file". Valid values are listed in the G4GCTTPF file (ie, googledoc, sheet, etc).

  • convert_file - Specify *YES if you wish to convert the file when downloaded. This option is only available for files already in a Google Doc format.

  • mime_type - If you are converting the file during the download, specify the mime type for the downloaded and converted file.

  • download_to_directory - The IFS Directory you wish to download the file to. Example: /myfiles/downloads

  • download_to_filename - The name of the file after it is downloaded. The value of *DFT can be used when specifying a download folder and download file. In this case the filename will be the same as the downloaded file name.

  • replace_file - Specify *YES (default) to replace a file if it exists when downloading it or *NO to stop and throw an error if the file already exists in the IFS.

  • ccsid - The CCSID to use. The default is 1252.

  • debug - Specify *YES to turn on debug, or *NO to turn off debug. The default is *NO.

  • debug_file - Specify the fully qualified file name for the main debug file. The default is /tmp/g4g_[id]_downloadFile.txt