using bff
This commit is contained in:
@@ -211,11 +211,14 @@ 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
|
||||
|
||||
# Send metadata as query params and chunk file as raw binary body
|
||||
# This works with Java proxy that forwards body as-is
|
||||
# Base64 encode the chunk so Java proxy can handle it as text/String
|
||||
# This prevents corruption when proxy reads binary data as String
|
||||
CHUNK_BASE64=$(base64 < "$chunk_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: application/octet-stream" \
|
||||
--data-binary "@$chunk_file")
|
||||
-H "Content-Type: text/plain" \
|
||||
-H "X-Chunk-Encoding: base64" \
|
||||
-d "$CHUNK_BASE64")
|
||||
|
||||
if [ "$DEBUG_MODE" = "true" ]; then
|
||||
echo "DEBUG: Chunk response: $RESPONSE"
|
||||
|
||||
Reference in New Issue
Block a user