Service cases API attachment upload fails for files over 10MB

Our service case management system is blocking support workflows because the REST API fails when uploading attachments larger than 10MB. We’re getting HTTP 413 errors consistently for files above this threshold.

Current implementation:


POST /sap/c4c/api/v1/service-cases/{caseId}/attachments
Content-Type: multipart/form-data
File: customer_logs.zip (15.2 MB)

Error response:


HTTP/1.1 413 Payload Too Large
{"error": "Request entity exceeds maximum size limit"}

This is blocking our support team since customers frequently need to upload diagnostic logs, screenshots, and video recordings that exceed 10MB. We’ve checked the API documentation but file size limits aren’t clearly specified. Is there a configuration to increase this limit, or do we need to implement chunked uploads? What’s the recommended approach for handling large file attachments in SCX 2105?

The 10MB limit is actually a default configuration in the API gateway layer, not a hard system limit. You can increase it, but I’d recommend implementing chunked uploads instead for better reliability and user experience. Large single-request uploads can timeout or fail due to network issues. Chunked approach also allows progress tracking and resume capability.

One thing to watch out for: the 413 error can also come from intermediate proxies or load balancers, not just the API gateway. Check your entire request path. We discovered our corporate proxy was enforcing a 20MB limit that wasn’t documented anywhere. Spent days troubleshooting the wrong layer. Use curl with verbose logging to identify exactly where the rejection happens.

Thanks for the insights. We’re leaning toward chunked uploads. Does SAP CX provide a built-in chunked upload API for service case attachments, or do we need to build custom logic? Also wondering about the chunk size - what’s optimal for balancing performance and reliability?

SCX 2105 supports chunked uploads through the multipart upload API pattern. You’ll need to implement the client-side logic to split files and track upload sessions. Recommended chunk size is 5MB - large enough to minimize overhead but small enough to handle network interruptions gracefully. The API supports resumable uploads if you store the upload session ID.

Let me provide a comprehensive solution addressing all three aspects of your attachment upload challenge.

Understanding File Size Limits: The 10MB limit you’re hitting is the default maximum request size configured in the SAP CX API gateway for SCX 2105. This is intentional - large single-request uploads can cause memory issues and timeout problems. While you can increase this limit to 25-50MB via gateway configuration, this isn’t recommended for production environments because:

  1. Large uploads tie up API worker threads for extended periods
  2. Network interruptions force complete re-uploads
  3. No progress tracking capability for end users
  4. Higher memory consumption on API nodes

The hard system limit for attachments in service cases is actually 100MB per file, but reaching it via single-request uploads is problematic.

Troubleshooting 413 Errors: Your error indicates request rejection at the API gateway level. To confirm the exact rejection point:

  1. Check response headers for X-Gateway-Error or similar identifiers
  2. Review API gateway logs (typically in /var/log/api-gateway/) for detailed rejection reasons
  3. Verify no intermediate proxies are enforcing stricter limits
  4. Test with curl to isolate client-side vs server-side issues

Common causes beyond gateway limits: reverse proxy configuration, cloud provider request limits (if using cloud deployment), or corporate network proxies.

Implementing Chunked Upload Logic: The recommended approach is implementing multipart chunked uploads. Here’s the proper implementation pattern:

Step 1 - Initialize upload session:


POST /sap/c4c/api/v1/service-cases/{caseId}/attachments/init
{"fileName": "logs.zip", "fileSize": 15728640, "chunkSize": 5242880}
Response: {"uploadId": "abc123", "totalChunks": 3}

Step 2 - Upload chunks sequentially:


PUT /sap/c4c/api/v1/attachments/upload/{uploadId}/chunk/{chunkNumber}
Content-Range: bytes 0-5242879/15728640
[Binary chunk data]

Step 3 - Complete upload:


POST /sap/c4c/api/v1/attachments/upload/{uploadId}/complete
{"md5Checksum": "calculated_hash"}

Implementation Best Practices:

  • Use 5MB chunk size (5242880 bytes) - optimal balance for performance and reliability
  • Implement retry logic with exponential backoff for failed chunks
  • Store upload session state (uploadId, completed chunks) for resume capability
  • Calculate and verify MD5 checksums to ensure data integrity
  • Set chunk upload timeout to 30 seconds (allows for slower connections)
  • Implement progress tracking by monitoring completed chunks
  • Clean up abandoned upload sessions after 24 hours

This approach handles files up to 100MB reliably, provides progress feedback, and allows resuming interrupted uploads. The chunked pattern is also more efficient for the API layer since it processes smaller requests that don’t block worker threads.

For immediate resolution while implementing chunked uploads, you can temporarily increase the gateway limit to 25MB by updating the api-gateway.properties configuration, but plan to migrate to chunked uploads within your next sprint.