O'Reilly logo

Xamarin Mobile Application Development for Android - Second Edition by Nilanchala Panigrahy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Upload an image using an HTTP multipart

The last functionality we are left to incorporate in the POIApp sample application is to upload the captured POI image to the server. Currently, we are saving only the POI details on Cloud, and the POI images are stored locally on the user's device memory. It would be nice to upload the image to the server so that we don't lose the images when a user deletes them locally from a device.

If the user has captured the photo of the POI and it is available locally on the device memory, then the save action will post the image along with the data using multipart form upload. Otherwise, it will post just the POI JSON data for the save operation.

Before we create a multipart form data request, let's first understand ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required