sc_api_dowload(profile, settings, file, destination)
|
|
This macro is used to download files using the Storage APIs for your cloud storage service.
It has the parameters:
| Parameters |
Description |
| profile |
When informing the "profile" it will load the settings informed in the creation of the API. |
| settings |
If you do not want to enter the profile value, you need to pass the "settings" parameters following the tools> API configuration. |
| file |
Name of the file |
| destination |
Directory where the file is stored. |
When informing the "profile" it will load the settings informed in the creation of the API.
Example:
sc_api_download([ 'profile' => 'myApi', 'file' => {file}, 'destination' => {destination}, ]);
If you do not want to enter the value of the profile, it will be necessary to pass the parameters of the "settings" following the configuration in Tools > API. You must enter the credentials for each storage service.
Examples using Google Driver
sc_api_download([
'settings' => [
'app_name' => {appname},
'gateway' => 'google_drive',
'json_oauth' => {jsonoauth},
'auth_code' => {authcode},
'token_code' => {tokencode},
],
'file' => {files},
'destination' => {destination}, ]);
Examples using Dropbox
sc_api_download([ 'settings' => [
'gateway' => 'dropbox',
'api_key' => {apikey},
'api_secret' => {apisecret},
'access_token' => {accesstoken},
],
'file' => {file},
'destination' => {destination},
]);
Examples using Amazon S3
sc_api_download([
'settings' => [
'app_name' => 'scriptcase',
'gateway' => 'S3',
'api_key' => {apikey},
'api_secret' => {apisecret},
'region' => {api_region},
'bucket' => {api_bucket},
],
'file' => {file},
'destination' => {destination}, ]);
|
Macro Scope
|
Grid application
|
Form application
|
| onRecord
|
onLoadAll onRecord
|
|