push fixes
This commit is contained in:
@@ -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"
|
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
|
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
|
# 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" \
|
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 "Content-Type: text/plain" \
|
||||||
-H "X-Chunk-Encoding: base64" \
|
-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
|
if [ "$DEBUG_MODE" = "true" ]; then
|
||||||
echo "DEBUG: Chunk response: $RESPONSE"
|
echo "DEBUG: Chunk response: $RESPONSE"
|
||||||
|
|||||||
Reference in New Issue
Block a user