Overview
In Oracle Integration Cloud (OIC), there are scenarios where we need to receive files directly from an external application through a REST API and then place those files into an SFTP location.
Usually, files like CSV, ZIP, PDF, or other binary content are handled as file-based data. In this blog, we will see how to configure an OIC integration to accept a binary file as input through a REST trigger, write that file to SFTP in binary mode, and finally return a successful JSON response with file details.
Use Case
The requirement is to:
- Expose a REST endpoint in OIC.
- Accept a file directly as a binary payload.
- Write the received binary file to an SFTP directory.
- Return a JSON response containing file details such as:
- File name
- Directory
- Status
- Uploaded date
This approach is useful when the source system sends the file directly in the REST request body instead of sending file content as Base64 or multipart form data.
High-Level Flow
The integration flow is as follows:
Prerequisites
Before creating the integration, make sure the following are available:
- Oracle Integration Cloud instance access
- REST connection with Trigger role
- SFTP connection configured successfully
- Target SFTP directory details
- Required file naming convention
- Sample JSON response structure
Step 1: Create REST Connection with Trigger Role
First, create a REST connection in OIC.
While creating the REST connection, select the role as: Trigger
This REST connection will be used to expose the integration as an API endpoint.
Once the REST connection is created and tested successfully, it can be used as the starting point of the integration.
Step 2: Create and Test SFTP Connection
Next, create an SFTP connection in OIC.
Provide the required SFTP details such as:
- SFTP host
- Port
- Username
- Password or private key
- Known host key details, if applicable
After entering the required details, test the connection.
The connection should be established successfully before using it in the integration.
Step 3: Create App-Driven Orchestration Integration
Create a new integration in OIC using:App Driven Orchestration
Add the REST connection as the trigger.
Step 4: Configure REST Trigger Operation
- Configure the REST trigger with a POST operation.
- In the request configuration, select the request payload format as:Binary
- In the REST trigger configuration, mention the content type as:Other Media Type
- Then provide the media type as:application/csv
- If you are handling other file types, you can change the media type accordingly.
- application/pdf
- application/zip
- application/octet-stream
- text/csv
Step 5: Configure REST Response as JSON
In the response part of the REST trigger, select the response payload format as:JSON Sample
Use the below sample JSON response:
{
"File Properties": {
"FileName": "sfghsfh",
"Directory": "djsdgj",
"status": "gjsgjds",
"UploadedDate": "25-dec-2026"
}
}
This sample will generate the response structure in the mapper.
You can later map actual values from the SFTP write response or assign custom values.
Step 6: Add SFTP Adapter in the Integration Flow
After successfully creating the REST trigger, add the SFTP adapter in the integration flow.
Select the SFTP connection and configure the operation as:Write

Step 7: Configure Target Directory and File Name
- Provide the target SFTP directory where the file should be written.
- You can provide the file name directly in the SFTP configuration or dynamically map it later in the mapper. Map REST Binary Payload to SFTP Write
Now open the mapper between the REST trigger and SFTP write activity.
Map the incoming binary payload from the REST trigger request to the SFTP file reference/content field.
The binary stream received from the REST POST request should be passed directly to the SFTP write operation.
Map SFTP Response to REST Response
After the SFTP write operation is completed, map the response from the SFTP activity to the REST response mapper.
Map the output fields as required.
Conclusion
Using this approach, we can directly accept binary files in Oracle Integration Cloud through a REST trigger and write them to an SFTP location without converting the file content into Base64 or any other format.
This is a simple and effective solution when an external application sends files directly through a REST API. By configuring the REST request payload as Binary and the SFTP transfer mode as Binary, OIC can handle the file smoothly and return a proper JSON response after successful upload.
This helps in building clean file-upload integrations where the source system gets an immediate confirmation response with file details after the file is written to SFTP.







Top comments (0)