转换后的下载文件优先使用七牛表单上传 #87

Merged
WuYongJie merged 1 commits from codex/direct-download-archive-20261113 into main 2026-11-13 18:45:52 +08:00

View File

@ -38,7 +38,7 @@ export async function prepareImageArchiveDownload(id: string) {
phase = "store";
const url = source.buffer.equals(asset.bytes) && asset.contentType === "image/png"
? task.targetUrl
: (await uploadFile(`canvas-download-${randomUUID()}.${asset.filename.split(".").pop() || "png"}`, Uint8Array.from(asset.bytes).buffer)).url;
: (await uploadFile(`canvas-download-${randomUUID()}.${asset.filename.split(".").pop() || "png"}`, Uint8Array.from(asset.bytes).buffer, { preferQiniuForm: true })).url;
await saveImageDownloadAsset(id, { status: "ready", url, bytes: asset.bytes.length,
contentType: asset.contentType, preparedAt: new Date().toISOString() });
await cacheImageBytes(`source::${url}`, { buffer: asset.bytes, contentType: asset.contentType });