Download File Stream
The Download File Stream API downloads a streamed file from an IDO
collection. The IDO collection must have a property for storing binary data.
Note: This topic is for REST Version 1. There is also an API for REST Version 2.
Parameters
Name | In | Required? | Description |
---|---|---|---|
ido | Query | Yes | This is the name of the IDO collection. |
prop | Query | Yes | This is the name of an IDO property. |
rp | Query | No | This is the value of an IDO row pointer. Note: This is optional if the
filter parameter is used.
|
filter | Query | No | This applies a filter for the required row. If multiple rows returned, the
first row is selected. For optimal performance, use a filter that returns only one
row. Note: This parameter is optional if the rp parameter is used.
|
Headers
Name | Description |
---|---|
Authorization | If the API is called directly, then a Mongoose security token
is obtained through a call to the GetSecurityToken API. If the API is called through ION API, then a valid OAuth2.0 bearer token is provided by ION API. |
X-Infor-MongooseConfig | This is the name of a configuration that is available on the application server. This is required only when using the Mongoose API through the ION API. |
Request data
None
Response data
The response is an unencoded binary stream of the file, with the content-type of application/octet-stream.
Example
This example code downloads a user image from the users table.
var xml = string.Empty; using ( HttpClient client = new HttpClient() ) { string ido = "UserNames"; string prop = "UserImage"; string rp = "2807a627-577b-462e-9494-aee568152c54"; string requestUrl = $"http://server/IDORequestService/MGRESTService.svc/io/downloadfile/?ido={ido}&prop={prop}&rp={rp}"; // provide token in the Authorization header client.DefaultRequestHeaders.TryAddWithoutValidation( "Authorization", "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…==" ); HttpResponseMessage response = client.GetAsync( requestUrl ).Result; using ( HttpContent content = response.Content ) { Task<string> result = content.ReadAsStringAsync(); xml = result.Result; } }