       body: chunk
          });

          currentChunk = i + 1;
          chunkInfo.textContent = `${currentChunk} / ${totalChunks}`;
        }

        await fetch('/upload/complete', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({ uploadId, fileName: file.name, totalChunks })
        });

        // Show success
        successMessage.classList.remove('hidden');
        buttonText.textContent = 'Upload Another File';
        
      