Here’s a comprehensive solution addressing all three critical areas:
API Gateway File Size Limits:
The 413 error indicates you’ve hit the default 5MB limit for mobile API endpoints. Increase this limit in your API Gateway configuration:
- Navigate to: Tools > Integration Cloud > API Platform Gateway
- Select your supplier portal API policy
- Modify the Request Size Limit policy:
Max Request Size: 26214400 (25MB in bytes)
Apply to: Mobile endpoints
Path Pattern: /supplierPortal/attachments/*
Also update the reverse proxy configuration if you’re using Oracle Web Gateway:
ProxyIOBufferSize 65536
LimitRequestBody 26214400
Multipart Upload Handling:
Your mobile app needs to implement chunked uploads for files over 2MB. The current implementation is trying to send the entire file in one request, which causes both size limit and timeout issues. Implement this approach:
- Split files into 2MB chunks
- Upload each chunk with Content-Range headers
- Use the resumable upload API endpoint
Pseudocode for mobile app implementation:
// Pseudocode - Chunked upload implementation:
1. Calculate total chunks: fileSize / chunkSize (2MB)
2. For each chunk:
a. Read chunk bytes from file
b. Set header: Content-Range: bytes start-end/total
c. POST to /fscmRestApi/resources/supplierPortal/attachments/chunked
d. Store upload session ID from response
3. Send final commit request with session ID
4. Handle resume logic if network fails mid-upload
// Reference: Oracle Fusion REST API Guide Section 8.4
Server-Side Error Logs Analysis:
Enable detailed logging to track upload progress and identify failure points:
- Set logging level for attachment uploads:
Logger: oracle.apps.scm.supplierPortal.attachments
Level: FINE
Include: request headers, content length, upload duration
-
Monitor these specific error patterns in logs:
- 413 Payload Too Large: API gateway limit hit
- 504 Gateway Timeout: Timeout before upload completes
- 500 Internal Server Error: Backend storage issue
-
Check backend storage quotas - ensure your file repository has sufficient space
Additional Configuration:
Increase timeout values to accommodate large file uploads over mobile networks:
API Gateway > Timeout Configuration
Read Timeout: 300 seconds
Write Timeout: 300 seconds
Keep-Alive Timeout: 120 seconds
For optimal performance, implement these mobile app enhancements:
- Show upload progress bar with chunk-level granularity
- Implement automatic retry for failed chunks
- Cache partially uploaded chunks locally for resume capability
- Compress files before upload if they’re not already compressed
After these changes, suppliers should be able to upload files up to 25MB from the mobile app. The chunked upload approach also provides better reliability on unstable mobile connections. Monitor your server-side logs for the first few days to ensure the new configuration handles the increased load without performance degradation.
One final recommendation: implement a file size warning in the mobile app that suggests switching to desktop for files over 10MB, as upload time and battery consumption can be significant for very large files on mobile devices.