DEV Community


Discussion on: Connecting to WordPress using C#

whitear27 profile image
Audrey White

Hi, this post has been super helpful to me. I am a student developing a Xamarin iOS app for a current Wordpress WooCommerce site. I was able to retrieve the products and display within the app. I can also add products, however I am unable to upload images from my iPhone into the WordPress wp-content library. Is there a way to upload images directly to the wp-content media library with WordPress PCL?
Thank you for this post!

yeisonpx profile image
Yeison Lapaix Author

Hi Audrey, thanks to you for your feedback. You can upload images using the client.Media object and methods. For example:

 var createdMedia = await client.Media.Create(@"C:\pathToFile\media.jpg","media.jpg");

Check more details here in the documentation: Working with Medias

I hope this can help you.