mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-06 20:10:05 +00:00
fix: should not create blob in node
This commit is contained in:
@@ -26,11 +26,18 @@ export const generateFileUploadForm = (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const file = new Blob([csv], {
|
if (typeof FormData === 'undefined' && formData instanceof NodeFormData) {
|
||||||
type: 'application/csv'
|
formData.append(name, csv, {
|
||||||
})
|
filename: `${name}.csv`,
|
||||||
|
contentType: 'application/csv'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const file = new Blob([csv], {
|
||||||
|
type: 'application/csv'
|
||||||
|
})
|
||||||
|
|
||||||
formData.append(name, file, `${name}.csv`)
|
formData.append(name, file, `${name}.csv`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return formData
|
return formData
|
||||||
|
|||||||
Reference in New Issue
Block a user