• 0
Alejandro Ortíz

Problema subiendo imágenes al servidor de MercadoLibre

Question

Hola, llevo algunos dias tratando de utilizar la función de mercadolibre para porteas imágenes para luego relacionarlas con los productos(https://developers.mercadolibre.com/es_ar/trabajar-con-imagenes), estoy usando PHP y en la documentación no se explica como hacer la petición.
todas las peticiones que hago me responden algo como esto...
 

Array
(
    [body] => stdClass Object
        (
            [id] => 611237-MLM28011009175_082018
            [max_size] => 500x500
            [dominant_color] => 
            [crop] => stdClass Object
                (
                    [y_size] => 
                    [x_size] => 
                    [y_offset] => 
                    [x_offset] => 
                )

            [variations] => Array
                (
                    [0] => stdClass Object
                        (
                            [size] => 500x500
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=F&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=F&f=proccesing_image_es.jpg
                        )

                    [1] => stdClass Object
                        (
                            [size] => 500x500
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=O&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=O&f=proccesing_image_es.jpg
                        )

                    [2] => stdClass Object
                        (
                            [size] => 400x400
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=C&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=C&f=proccesing_image_es.jpg
                        )

                    [3] => stdClass Object
                        (
                            [size] => 320x320
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=V&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=V&f=proccesing_image_es.jpg
                        )

                    [4] => stdClass Object
                        (
                            [size] => 280x280
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=E&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=E&f=proccesing_image_es.jpg
                        )

                    [5] => stdClass Object
                        (
                            [size] => 250x250
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=P&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=P&f=proccesing_image_es.jpg
                        )

                    [6] => stdClass Object
                        (
                            [size] => 228x228
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=A&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=A&f=proccesing_image_es.jpg
                        )

                    [7] => stdClass Object
                        (
                            [size] => 210x210
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=Y&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=Y&f=proccesing_image_es.jpg
                        )

                    [8] => stdClass Object
                        (
                            [size] => 200x200
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=N&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=N&f=proccesing_image_es.jpg
                        )

                    [9] => stdClass Object
                        (
                            [size] => 160x160
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=T&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=T&f=proccesing_image_es.jpg
                        )

                    [10] => stdClass Object
                        (
                            [size] => 160x160
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=Z&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=Z&f=proccesing_image_es.jpg
                        )

                    [11] => stdClass Object
                        (
                            [size] => 120x120
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=G&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=G&f=proccesing_image_es.jpg
                        )

                    [12] => stdClass Object
                        (
                            [size] => 90x90
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=I&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=I&f=proccesing_image_es.jpg
                        )

                    [13] => stdClass Object
                        (
                            [size] => 90x90
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=S&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=S&f=proccesing_image_es.jpg
                        )

                    [14] => stdClass Object
                        (
                            [size] => 70x70
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=R&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=R&f=proccesing_image_es.jpg
                        )

                    [15] => stdClass Object
                        (
                            [size] => 40x40
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=M&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=M&f=proccesing_image_es.jpg
                        )

                    [16] => stdClass Object
                        (
                            [size] => 800x800
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=B&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=B&f=proccesing_image_es.jpg
                        )

                )

            [source] => https://MiPagina.com/imagenes/MEMBLC520_0_400.jpg
        )

    [httpCode] => 201
)

y al utilizar la API para ver los errores me da algo como esto
{
    "id": "615969-MLM28010912161_082018",
    "source": "http://MiPagina/imagenes/MEMBLC520_0_400.jpg",
    "error": "{error_code=content_type, meta={responseCode=301, responseMessage=Moved Permanently, contentType=text/html; charset=iso-8859-1, contentLength=256, contentEncoding=null}}"
}

¿alguien a tenido el mismo problema? ¿que soluciones hay para esto? 

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
2 hours ago, Alejandro Ortíz said:

si, si uso la ruta en el navegador me manda directo a la imagen.

pero en el navegador és diferente, se un sistema la utiliza redirecciones puedem causar errores

Share this post


Link to post
Share on other sites
  • 0
On 8/22/2018 at 1:36 PM, Alejandro Ortíz said:

Hola, llevo algunos dias tratando de utilizar la función de mercadolibre para porteas imágenes para luego relacionarlas con los productos(https://developers.mercadolibre.com/es_ar/trabajar-con-imagenes), estoy usando PHP y en la documentación no se explica como hacer la petición.
todas las peticiones que hago me responden algo como esto...
 


Array
(
    [body] => stdClass Object
        (
            [id] => 611237-MLM28011009175_082018
            [max_size] => 500x500
            [dominant_color] => 
            [crop] => stdClass Object
                (
                    [y_size] => 
                    [x_size] => 
                    [y_offset] => 
                    [x_offset] => 
                )

            [variations] => Array
                (
                    [0] => stdClass Object
                        (
                            [size] => 500x500
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=F&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=F&f=proccesing_image_es.jpg
                        )

                    [1] => stdClass Object
                        (
                            [size] => 500x500
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=O&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=O&f=proccesing_image_es.jpg
                        )

                    [2] => stdClass Object
                        (
                            [size] => 400x400
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=C&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=C&f=proccesing_image_es.jpg
                        )

                    [3] => stdClass Object
                        (
                            [size] => 320x320
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=V&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=V&f=proccesing_image_es.jpg
                        )

                    [4] => stdClass Object
                        (
                            [size] => 280x280
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=E&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=E&f=proccesing_image_es.jpg
                        )

                    [5] => stdClass Object
                        (
                            [size] => 250x250
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=P&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=P&f=proccesing_image_es.jpg
                        )

                    [6] => stdClass Object
                        (
                            [size] => 228x228
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=A&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=A&f=proccesing_image_es.jpg
                        )

                    [7] => stdClass Object
                        (
                            [size] => 210x210
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=Y&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=Y&f=proccesing_image_es.jpg
                        )

                    [8] => stdClass Object
                        (
                            [size] => 200x200
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=N&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=N&f=proccesing_image_es.jpg
                        )

                    [9] => stdClass Object
                        (
                            [size] => 160x160
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=T&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=T&f=proccesing_image_es.jpg
                        )

                    [10] => stdClass Object
                        (
                            [size] => 160x160
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=Z&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=Z&f=proccesing_image_es.jpg
                        )

                    [11] => stdClass Object
                        (
                            [size] => 120x120
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=G&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=G&f=proccesing_image_es.jpg
                        )

                    [12] => stdClass Object
                        (
                            [size] => 90x90
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=I&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=I&f=proccesing_image_es.jpg
                        )

                    [13] => stdClass Object
                        (
                            [size] => 90x90
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=S&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=S&f=proccesing_image_es.jpg
                        )

                    [14] => stdClass Object
                        (
                            [size] => 70x70
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=R&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=R&f=proccesing_image_es.jpg
                        )

                    [15] => stdClass Object
                        (
                            [size] => 40x40
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=M&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=M&f=proccesing_image_es.jpg
                        )

                    [16] => stdClass Object
                        (
                            [size] => 800x800
                            [url] => https://www.mercadolibre.com/jm/img?s=STC&v=B&f=proccesing_image_es.jpg
                            [secure_url] => http://www.mercadolibre.com/jm/img?s=STC&v=B&f=proccesing_image_es.jpg
                        )

                )

            [source] => https://MiPagina.com/imagenes/MEMBLC520_0_400.jpg
        )

    [httpCode] => 201
)

y al utilizar la API para ver los errores me da algo como esto
{
    "id": "615969-MLM28010912161_082018",
    "source": "http://MiPagina/imagenes/MEMBLC520_0_400.jpg",
    "error": "{error_code=content_type, meta={responseCode=301, responseMessage=Moved Permanently, contentType=text/html; charset=iso-8859-1, contentLength=256, contentEncoding=null}}"
}

¿alguien a tenido el mismo problema? ¿que soluciones hay para esto? 

Amigo revisa el CDN. Adjunto imagen.

forum.png

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