Increase the default file size in the upload_stream method
i am using the following method to upload files:
let fileUploadToCloud = (files) => {
//console.log(files);
returnnewPromise((resolve,reject) => {
letstream=cloudinary.uploader.upload_stream(
{ folder: "Mongia", chunk_size: 100000000 },
(error, result) => {
if (result) {
resolve(result);
} else {
reject(error);
}
}
);
files.forEach((item) => {
//console.log(item.buffer);
streamifier.createReadStream(item.buffer).pipe(stream);
});
});
};
Now I am facing 2 problems here:
1: the chunk_size is not increasing the default limit on the file size due to which I can not upload videos/files larger than the default limit, How do I increase the default limit?
2: I want to send an array of files with n number of elements and upload them all one by one, How can I achieve that?
1: the chunk_size is not increasing the default limit on the file size due to which I can not upload videos/files larger than the default limit, How do I increase the default limit?
2: I want to send an array of files with n number of elements and upload them all one by one, How can I achieve that?
0
-
Hi Atanu,
Let me answer your questions:
1. You can use the method upload_chunked_stream to upload the stream in chunks.
2. The way you iterate the elements on your array looks fine. However, I think the function you need to call the Cloudinary method should be letstream.
files.forEach(item => {streamifier.createReadStream(item.buffer).pipe(letstream);});Please let me know if these work.
Regards,
Francis0
Post is closed for comments.
Comments
1 comment