mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-08 13:00:05 +00:00
chore(file-upload-form): left comments
This commit is contained in:
@@ -27,14 +27,15 @@ export const generateFileUploadForm = (
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// INFO: unfortunately it is not possible to check if formData is instance of NodeFormData or FormData because it will return true for both
|
||||||
if (isNode()) {
|
if (isNode()) {
|
||||||
// environment is Node and formData is instance of NodeFormData
|
// INFO: environment is Node and formData is instance of NodeFormData
|
||||||
;(formData as NodeFormData).append(name, csv, {
|
;(formData as NodeFormData).append(name, csv, {
|
||||||
filename: `${name}.csv`,
|
filename: `${name}.csv`,
|
||||||
contentType: 'application/csv'
|
contentType: 'application/csv'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// environment is Browser and formData is instance of FormData
|
// INFO: environment is Browser and formData is instance of FormData
|
||||||
const file = new Blob([csv], {
|
const file = new Blob([csv], {
|
||||||
type: 'application/csv'
|
type: 'application/csv'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user