1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-18 17:40:06 +00:00

fix: should not create blob in node

This commit is contained in:
2022-03-24 02:43:14 +05:00
parent 256e4ef314
commit d0eb1a7bfb

View File

@@ -26,12 +26,19 @@ export const generateFileUploadForm = (
) )
} }
if (typeof FormData === 'undefined' && formData instanceof NodeFormData) {
formData.append(name, csv, {
filename: `${name}.csv`,
contentType: 'application/csv'
})
} else {
const file = new Blob([csv], { const file = new Blob([csv], {
type: 'application/csv' type: 'application/csv'
}) })
formData.append(name, file, `${name}.csv`) formData.append(name, file, `${name}.csv`)
} }
}
return formData return formData
} }