• 0

Mercadolibre reject uploaded picture because of invalid format


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!



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


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now