0

I am having troubles uploading an image to Etsy through my Ruby on Rails app. Following the Etsy API and the Etsy gem, I send a post request to /listings/#{listing_id}/images. The params are:

{:require_secure=>true, 
:image=>#<File:/tmp/RackMultipart20150928-12064-1ctbfdu.jpg>, :type=>"image/jpg",
:multipart=>true, 
:listing_id=>249197834}

However, I get this error:

'The image array metadata doesn't look like a _FILES array'

Pang
  • 9,564
  • 146
  • 81
  • 122
M D
  • 1
  • Not sure but this might help you http://stackoverflow.com/questions/32282899/etsy-image-add-returning-500-error-metadata-doesnt-look-like-a-files-array . Seems like issue related to authentication. – Dipak Gupta Sep 28 '15 at 11:49
  • No, the problem was the multipart post. I fixed it by using the [oauth-multipart](https://github.com/aotianlong/oauth-multipart) gem – M D Sep 28 '15 at 15:07

1 Answers1

0

According to Etsy image gem, only send three parameter image, multipart and listing_id. You can set params like.

{
 image: open('/tmp/RackMultipart20150928-12064-1ctbfdu.jpg'),
 multipart: true,
 listing_id: 249197834
}