fix(core): update
This commit is contained in:
parent
189916e62b
commit
71a6ffef96
@ -35,11 +35,13 @@ const appendFormField = async (
|
|||||||
formDataField: IFormField
|
formDataField: IFormField
|
||||||
) => {
|
) => {
|
||||||
if (formDataField.type === "filePath") {
|
if (formDataField.type === "filePath") {
|
||||||
formDataArg.append("type", "image");
|
let fileData = plugins.fs.readFileSync(
|
||||||
let fileData = plugins.fs.createReadStream(
|
|
||||||
plugins.path.join(process.cwd(), formDataField.payload)
|
plugins.path.join(process.cwd(), formDataField.payload)
|
||||||
);
|
);
|
||||||
formDataArg.append("media", fileData, "upload.pdf");
|
formDataArg.append("file", fileData, {
|
||||||
|
filename: 'upload.pdf',
|
||||||
|
contentType: 'application/pdf'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user