inakiabt / etsy-php

Etsy API wrapper for PHP
74 stars 59 forks source link

Image is not uploading. #22

Closed xiaEngineer closed 7 years ago

xiaEngineer commented 7 years ago

I tried to use as you provided in example like: $method = 'uploadListingImage'; $args = array( 'params' => array( 'listing_id' => 123456 ), 'data' => array( 'image' => array('file.jpg;type=image/jpeg') ) );

I used like:

$taxo = $api->uploadListingImage( array( 'params' => array( 'listing_id' => 509505496, ), 'data' => array( 'image'=> array('15.1.jpg;type=image/jpeg') ) ) );

I got the error message: 'Exception' with message 'Invalid params for method "uploadListingImage": Invalid data param type "image" (15.1.jpg;type=image/jpeg: string): required type "imagefile"

Note: my image path is the same of the script.

Thanks.

inakiabt commented 7 years ago

You forgot the @. Take a look to this example: https://github.com/inakiabt/etsy-php/blob/b38b81854af4b2fbbd70f0e7bb983852b27a105b/README.md#examples