vittorio

Members
  • Content count

    4
  • Joined

  • Last visited

  1. [PHP ]Uploading images from hard drive

    Thanks for your answer juvian! The problem is, I had already tried that, but the picture never shows. All i see is the "processing image" default image. The picture gets uploaded to the mercadolibre server (supposedly), since i get a 201 code when I examine the response. I also get the uploaded picture id and i'm able to retrieve the uploaded picture from the api. But there´s no way to see the picture. However if I use a picture already uploaded to certain public servers, the picture is visible inmeadiately. Last night I uploaded a picture directly from my hard drive using the code you mentioned and this morning still was "in process" so I take it that means it will never get uploaded. (I can´t wait 12 hours to upload a photo.) Here´s my code: //upload an image from the local hard drive to the mercadolibre server: $body2=array("source"=>"C:\xampp\htdocs\hgin\php-sdk-master\examples\logoHgin.jpg"); $response2 = $meli->post('/pictures', $body2, $params); //associate the recently uploaded picture to a previously created post $body3=array("id"=>"897268-MLA26367623449_112017", "max_size"=>"100*100"); $response3 = $meli->post('/items/MLA692059690/pictures', $body3, $params); Please note the part in bold, i'm using a file path, not an url because i'm trying to upload the pictures directly from the hard drive. Like i said i 'm able to do so, or at least both requests have a 201 response. But the picture never shows. Juvian, could you walk me through what I'm doing wrong? I need to upload the pictures directly from the hard drive. A million thanks in advance!!
  2. Hi! i 'm trying to post an item with pictures. I'm able to do so if i use public images that are hosted in some web pages Is it possible to use images from your own hard drive? without uploading them to a server? This is my code: $params = array('access_token' => $_SESSION['access_token']); $body = array("price" => '2', "title" => 'LOCAL 2ND TRIAL', "category_id"=> 'MLA40490', "currency_id"=>"ARS", "available_quantity"=>1, "condition"=>"used", "listing_type_id"=>"silver", "pictures"=>array(array("source"=>"C:\xampp\htdocs\logoHgin.jpeg")) ); $response = $meli->post('/items', $body, $params); It works perfectly if i replace the image url by a public one. The problem is i have hundreds of pics that i dont want to upload to a public server (it defeats the purpose of the app i'm writing). Is it possible to upload images directly from the hard drive?? Thanks in advance!!
  3. how to retrieve more than 200 items per request

    i already tried using offset, i have read the documentation. The question is weather its possible to retrieve more than 200 items per request. I guess that's the limit to not overwhlem the server or whatever. I benchmarked it and it takes around 3 seconds to retrieve 200 items, so it would require close to 17 hours to retrieve the 4 millons items in the books and magazines category. My question was how do i do to request more items faster, but i'm thinkig there isn´t really a way since the amount of data is huge.
  4. Hi I want to get all items in the books and magazines catagories from Argentina's site. I'm able to get a response but i only get (because of pagination) 200 items maximum. Is it possible to get all the items?(in this case there are 4 millions items, i know it's a lot.) Here´s my code: <?php require '../meliapp/Meli/meli.php'; $meli=new Meli(xxxxxxxxxx , xxxxxxxxxxxxxxxx); if (isset($_GET['code']) ): $oAuth = $meli->authorize($_GET['code'], 'http://localhost/meliapp/index.php'); if($oAuth['body']!==NULL || !empty($oAuth['body'])){ $_SESSION['access_token'] = $oAuth['body']->access_token; $_SESSION['token_type'] = $oAuth['body']->token_type; $_SESSION['expires_in'] = $oAuth['body']->expires_in; $_SESSION['scope'] = $oAuth['body']->scope; $_SESSION['user_id'] = $oAuth['body']->user_id; $_SESSION['refresh_token'] = $oAuth['body']->refresh_token; } endif; if(empty($_SESSION['access_token']) || !isset($_GET['code'])): echo "LOGIN NOW:<BR>"; echo '<a href="' . $meli->getAuthUrl('http://localhost/hgin/meliapp/index.php', Meli::$AUTH_URL['MLA']) . '">Login using MercadoLibre oAuth 2.0</a>'; endif; $params = array('category' => 'MLA3025', 'limit'=> '200'); $items = $meli->get('/sites/MLA/search', $params); The variable $items only holds 200 items. But i know from inspecting $items['body']->paging->total that there are 4 million items. Is there a way to get all 4 million items at once? or at least more than 200 items maximum per request. Thanks in advance!!!