• 0
hrkns

Mercadolibre reject uploaded picture because of invalid format

Question

I'm a facing a problem trying to upload pictures using the API

 

I'm working with NodeJS and using the mercadolibre package for Node (https://www.npmjs.com/package/mercadolibre) in order to upload the images, but the server always response with this message

{
    message: 'The file type is not supported: file. Valid file types are [jpg, jpeg, png, gif, webp].',
    error: 'file.content_type.invalid',
    status: 400,
    cause: [] 
}

I'm sure the images are being sent, because I've checked the implementation of the library and it uses the Needle package to make HTTP requests (POST with multipart as true to be more accurate), so I writte a little code (the same that is inside the implementation of upload method in the mercadolibre package for Node) but sending the content to a VPS of mine and I receive the image there with no problem

 

So... what could it be? Any help will be appreciated! Ask anything else that you think I should inform!

post-1747-0-80023500-1489173600_thumb.png

post-1747-0-65439700-1489174134_thumb.png

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

can you share the json where you are sending the url of the picture or if you are uploading the file

I'm sending binary data as multipart, I'm showing it in one of the attached files of my message

Share this post


Link to post
Share on other sites
  • 0

I download them (from Amazon WEb Service) using the needle module from NodeJS (it could be downloaded using the HTTP native module of Node, it's the same), and upload them to my VPS and to Mercadolibre API

 

it means it could be any image

 

I receive it with no problem in my server but Meli API tells me invalid format

 

I will attach to this message an image that I used

post-1747-0-73540100-1489419636_thumb.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...