Uploading image from a base64 string
Hello, when i try to upload a base64 image in NodeJS, even some small ones such as 368kb i get the following error:
Error: ENAMETOOLONG: name too long, open 'data: image / jpg; base64
Followed by the base64 code that represents the image.
However, when i try to upload small images like 4kb i have sucess... This link says I can upload base64 images up to 60mb, so why i cant upload 368kb?
I've seen this issue on several other posts but couldn't find an answer or explenation
I really appreciate any help you guys can provide.
-
Hey Miguel,
My problem was solved
Can't remember exactly what solved it for me but here is the upload code from the server:app.post(`/${url}`, function (req, res) {var dataURI = req.body.dataURI;var uploadStr = 'data:image/jpeg;base64,' + dataURI;
cloudinary.v2.uploader.upload(uploadStr, {overwrite: true,invalidate: true,width: 810, height: 456, crop: "fill"},function (error, result) {res.json(result);});});Hope it helpAsi -
Hi Asi,
Can you please open a support ticket via support@cloudinary.com and share the code responsible for the error alongside an example file that fails so we can further investigate the issue?
Thanks!
-
Buenos dias,
Estoy teniendo el mismo problemas y no puedo encontrar la solucion realmente.const uploaded = await cloudinary.uploader.upload(image, {upload_preset: 'winesImg'})ese seria el upload para subir la imagen a cloudinary, la propiedad image me llega por body la cual si la paso asi me tira el error de ENAMETOOLONG, en cambio, probe haciendo un console.log a lo que me llega y pegandolo en lugar de poner la image y si se carga en cloudinary. no puedo entender por que el error, estaria muy agradecido si puedieran ayudarme.---Good morning,
I am having the same problem and can't really find the solution.
const uploaded = await cloudinary.uploader.upload(image, {upload_preset: 'winesImg'})that would be the upload to upload the image to cloudinary, the image property arrives to me by body which if I pass it this way I get the error of ENAMETOOLONG, instead, try making a console.log to what I get and pasting it instead of putting the image and if it loads in cloudinary. I can not understand why the error, I would be very grateful if you could help me.
-
Hi Valentine,
Can you please help to open a support ticket here (https://support.cloudinary.com/hc/en-us/requests/new) and to provide us with image information and your cloud name so we can investigate the issue?
Thanks in advance.
Post is closed for comments.
Comments
6 comments