-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
formidable doesn't return Data URI (base64 encoded) of file for cloudinary #872
Comments
The encoding options is for receiving base64 files, it should not be used, it overrides transfer encoding of the one who sends file. Use something like buf.toString('base64') on the file content to convert it to base64. |
Use the VolatileFile (overriding the default writing to disk, with options.fileWriteStreamHandler) approach and convert its buffer with toString. Soon it will be a lot easier, cuz Formidable will be more web-compliant with native File and FormData. |
Hopefully this helps someone. Took me a while to figure it out.
|
Support plan
Context
What are you trying to achieve or the steps to reproduce?
I try to upload the file uploaded to cloudinary by using formidable to get Data URI (base64 encoded) of file and then pass that data to first argument of cloudinary.uploader.upload(file: string). I thought I can use encoding property from formidable.Options in IncomingForm to make the files from callback of form.parse() return the file with data URI but I got empty {}. If I set encoding property at default "utf-8", the files will have file uploaded
What was the result you got?
{}
What result did you expect?
an object from files that contain property to get data URI like multer package from Express.js
The text was updated successfully, but these errors were encountered: