New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[error] can not append "object" as "Blob" #529
Comments
FormData doesn't support Blob. Try this instead. It works!
|
thank you for answer, but I already try this way before like this... const generateRequest = () => {
// somecode
returnOptions.headers = { ...returnOptions.headers, ...FD.getHeaders(), ...options.headers };
returnOptions.payload = FD.getBuffer();
return returnOptions;
} after this function, I send formData to my api but Joi cant validation // my Joi Validation
const JoiValidation = Joi.Object({
aa: joi.Array().items(Joi.Object({
oa: Joi.string(),
ob: Joi.string()
}))
}); |
same the problem. I have a blob pdf file. I need to insert it into the form data. NestJS, axios. |
Same problem, and according to the docs, FormData does support Blob: https://developer.mozilla.org/en-US/docs/Web/API/FormData/append |
it's a nightmare with bytes \ blobs and form-data |
Yeah, I don't get it how it so broken. I tried grabbing the Blob's |
Thank you, this resolved my issue and it worked as expected! |
the same problem, i solved it with formdata-node package |
but if i need it as blob to send it to multer , how can i do it ? |
environment
node - 15.7.0 (first version has blob as experimental)
form-data - ^4.0.0
problem
why
My api develop by Hapi framework and validate by Joi. When api get a request Hapi will use Joi validate payload first (not my code), I need to validate some key in payload as my expected object
joi exmaple
remark
JavaScript in html file can append blob
code
error
in html (work)
The text was updated successfully, but these errors were encountered: