From 23dacdd0c2c4cc246c5d56d3ddfbd9fe3a32aff4 Mon Sep 17 00:00:00 2001 From: pratik Date: Wed, 22 Oct 2025 15:19:57 -0500 Subject: [PATCH] push fixes --- deploy-chunked-simple.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/deploy-chunked-simple.sh b/deploy-chunked-simple.sh index 29e5c0e..1356181 100644 --- a/deploy-chunked-simple.sh +++ b/deploy-chunked-simple.sh @@ -211,14 +211,19 @@ upload_file_in_chunks() { echo "DEBUG: Uploading chunk to: $API_BASE/upload/chunk?uploadSessionId=$SESSION_ID&fileType=$file_type&chunkIndex=$chunk_index&totalChunks=$total_chunks&fileName=$file_name" fi - # Base64 encode the chunk so Java proxy can handle it as text/String + # Base64 encode the chunk to a temp file so Java proxy can handle it as text/String # This prevents corruption when proxy reads binary data as String - CHUNK_BASE64=$(base64 < "$chunk_file") + # Use temp file to avoid "Argument list too long" error + CHUNK_BASE64_FILE=$(mktemp) + base64 < "$chunk_file" > "$CHUNK_BASE64_FILE" RESPONSE=$(curl -s -X POST "$API_BASE/upload/chunk?uploadSessionId=$SESSION_ID&fileType=$file_type&chunkIndex=$chunk_index&totalChunks=$total_chunks&fileName=$file_name" \ -H "Content-Type: text/plain" \ -H "X-Chunk-Encoding: base64" \ - -d "$CHUNK_BASE64") + -d @"$CHUNK_BASE64_FILE") + + # Clean up temp file + rm -f "$CHUNK_BASE64_FILE" if [ "$DEBUG_MODE" = "true" ]; then echo "DEBUG: Chunk response: $RESPONSE"