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 = `
filename: | ${data.meta.name} |
---|---|
process duration: | ${data.meta.duration} |
size: | ${data.meta.sizeb} (${data.meta.sizeh}) |
sha1: | ${data.meta.sha1} |
md5: | ${data.meta.md5} |
${JSON.stringify(data, null, 2)}