async function process_upload(file) { const formData = new FormData(); formData.append('file', file); const button = document.querySelector('button'); button.setAttribute('aria-busy', 'true'); button.textContent = `processing ${file.name}...`; const response = await fetch('api/upload_file', { method: 'POST', body: formData, timeout: 600000 // 10 minutes }); if (response.ok) { const data = await response.json(); const container = document.querySelector('.container'); // visualization container.innerHTML = `

${data.meta.name}

blob meta
filename: ${data.meta.name}
process duration: ${data.meta.duration}
size: ${data.meta.sizeb} (${data.meta.sizeh})
sha1: ${data.meta.sha1}
md5: ${data.meta.md5}
Header
Body
Footer
Header
Body
Footer
${JSON.stringify(data, null, 2)}
`; } else { console.error('error uploading file'); } } function upload_file() { const fileInput = document.createElement('input'); fileInput.type = 'file'; fileInput.addEventListener('change', (event) => { const file = event.target.files[0]; process_upload(file); }); fileInput.click(); }