fix: 视频工具响应改二进制流+标准Content-Disposition(修复multipart包裹导致的客户端文件损坏); 修cgi bool异常
This commit is contained in:
1 parent
0ec5624add
commit
6bc2120c05
2 files changed
+18
-8
No files matched your search
@@ -218,9 +218,20 @@ async function process() {
|
||||
}
|
||||
const blob = await res.blob();
|
||||
const disp = res.headers.get('Content-Disposition') || '';
|
||||
const mStar = disp.match(/filename\*=UTF-8''([^;]+)/);
|
||||
const m = disp.match(/filename="([^"]+)"/);
|
||||
let outName = 'result';
|
||||
if (mStar) {
|
||||
try {
|
||||
outName = decodeURIComponent(mStar[1]);
|
||||
}
|
||||
catch { outName = 'result'; }
|
||||
}
|
||||
else if (m) {
|
||||
outName = m[1];
|
||||
}
|
||||
resultBlob.value = blob;
|
||||
resultName.value = m ? m[1] : 'result';
|
||||
resultName.value = outName;
|
||||
resultUrl.value = URL.createObjectURL(blob);
|
||||
spent.value = Math.round((Date.now() - t0) / 1000);
|
||||
genHist.add({ title: `${current.value.name}: ${file.value.name}`, detail: `→ ${resultName.value}(${(blob.size / 1024 / 1024).toFixed(1)}MB, ${spent.value}s)` });
|
||||
|
||||
Reference in new issue
Block a user