Replies: 1 comment
-
hi @priya-dsp 👋 There's ongoing work in #3232 to make file uploading easier. In the meantime you can do something like this: - post:
url: /upload
beforeRequest: attachFile # call a helper function to attach a file import * as fs from 'fs';
import FormData from 'form-data';
export async function attachFile(req, context, events) {
const formData = {
// "myfile" is the name of the file in the form
myfile: fs.createReadStream('./files/artillery-logo.jpg')
};
req.body = new FormData(formData);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @hassy , We are trying to upload pdf file or jpg image in post request. Post request body is in Xml format. We have converted pdf file into Base64 encoding, however the xml body is not getting passed in request. Can you suggest how to either upload file or any other alternative solution ?
Beta Was this translation helpful? Give feedback.
All reactions