Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload image for a product using API in and set Product properties in Spree in iOS application

Tags:

ios

spree

In my iOS app, i m creating product using spree API. Product is created successfully now i want to upload image for that product. But i not able to pass image to spree server. I use url "http://serverAddress:3000/api/images.json?token=" but dont fine how and what are the parameters to be pass. Pls help.Thanks

like image 796
Himanshu Mohan Avatar asked Jan 26 '26 12:01

Himanshu Mohan


1 Answers

you can do it with API:

  1. You must resize your image to usual spree sizes: large, mini, original, product, small.
  2. You can make a POST request for your variant and get info about all images in response. The main info - <id> of new image. Note, that your server must take a big string from your client.
  3. You must upload this images to folder ../public/spree/products/<id>
like image 168
Sergio Belevskij Avatar answered Jan 28 '26 03:01

Sergio Belevskij



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!