tage + "%";
          uploadedBytes.textContent = formatBytes(uploaded);
          
          console.log('Progress update:', progressData); // Debug logging
        } catch (error) {
          // Fallback: if it's just a number (old format)
          console.log('Raw progress data:', e.data);
          const percentage = parseInt(e.data, 10) || 0;
          progressBar.style.width = percentage + "%";
          progressPercent.textContent = percentage + "%";
        }
      });

      try {
        for (let