Showing error : Unsupported ZIP file
Broh!!!!!!!!, I got this problem with nodejs, images are correctly uploading but when i try to upload zip file, it showing error on my console : { message: 'Unsupported ZIP file', name: 'Error', http_code: 400 }
Here is my code:
const Order = require("../../models/Order/Order");
} catch (error) {
const asyncHandler = require("express-async-handler");
const cloudinary = require("../../utils/cloudinary");
const createOrder = asyncHandler(async (req, res) => {
try {
let files = [...req.body.files];
let filesBuffers = [];
for (let i = 0; i < files.length; i++) { const result = await cloudinary.uploader.upload(files[i], { folder: "orders", resource_type: "auto", }); filesBuffers.push({ public_id: result.public_id, image: result.secure_url, }); console.log(result); } req.body.files = filesBuffers; const service = await Order.create(req.body); res.json(service);
console.log(error);
}});
module.exports = { createOrder };
Please fix this problem, I am making my own startup on the internet.!!!!!!!!!!
-
Hi there,
Thanks for reaching out.
Looking into the logs on our end, I see the requests that failed with the error Unsupported ZIP file were sent with no resource type specified or they were sent with a resource type of image. Can you please try your uploads again using resource_type: 'raw' or resource_type: 'auto'? That should fix the problem. Let us know if it works for you.
If you have any questions, do not hesitate to ask.Kind Regards,
Tia
0
Post is closed for comments.
Comments
1 comment