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

Merge pull request #685 from sasjs/issue-684

fix: blob is not defined
This commit is contained in:
Allan Bowe
2022-03-28 14:26:58 +03:00
committed by GitHub

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
} }