v2.0 changes

This commit is contained in:
pratik
2025-10-22 14:00:32 -05:00
parent da16787fb2
commit 05d452c250
3 changed files with 94 additions and 5 deletions

View File

@@ -208,14 +208,14 @@ upload_file_in_chunks() {
if [ "$DEBUG_MODE" = "true" ]; then
echo ""
echo "DEBUG: SESSION_ID='$SESSION_ID'"
echo "DEBUG: Uploading 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
# Send metadata as query params (for Java proxy to capture) and only file as multipart
# Add explicit headers that nginx might require
# Send metadata as query params and chunk file as raw binary body
# This works with Java proxy that forwards body as-is
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 "X-Forwarded-For: 127.0.0.1" \
-F "chunk=@$chunk_file")
-H "Content-Type: application/octet-stream" \
--data-binary "@$chunk_file")
if [ "$DEBUG_MODE" = "true" ]; then
echo "DEBUG: Chunk response: $RESPONSE"