DownloadFileStream
The DownloadFileStream 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 2. There is also an API for REST Version 1.
Parameters
Name | In | Required? | Description |
---|---|---|---|
ido | Path | Yes | This is the name of the IDO collection. |
property | Query | Yes | This is the name of an IDO property for storing binary data. |
rp | Query | Yes | This is the value of an IDO row pointer. |
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
Unencoded binary stream of the file, with content-type of “application/octet-stream”.
Example
This example code downloads a user image from the users table.
string json = string.Empty; using ( HttpClient client = new HttpClient() ) { string ido = "UserNames"; string property = "UserImage"; string rowpointer = "4d6cb1eb-e4fc-4e12-aae8-95ff1086ee8c"; string requestUrl = $"http://server/IDORequestService/ido/file/{ido}?property={property}&rowPointer={rowpointer}"; // provide token in the Authorization header client.DefaultRequestHeaders.TryAddWithoutValidation( "Authorization", "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…==" ); // send the get request HttpResponseMessage response = client.GetAsync( requestUrl ).Result; using ( HttpContent content = response.Content ) { Task<string> result = content.ReadAsStringAsync(); json = result.Result; } }