Jason Carmen
Posts: 0
Joined: Wed Mar 05, 2014 1:51 pm

Mapping ImageUpload Response Content to Image control from HTML control post

How do you set the response of an API ImageUpload Post to the Asset property of an Image when using the HTML File Upload to post to the external API?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mapping ImageUpload Response Content to Image control from HTML control post

Hello!
Could you clarify where do you post and what you have in response from service?

Jason Carmen
Posts: 0
Joined: Wed Mar 05, 2014 1:51 pm

Mapping ImageUpload Response Content to Image control from HTML control post

Hi Posting to this url:
http://www.fangatez.com/api/ImageUpload

Response: http://www.fangatez.com/IMAGES/page2-...

I want to be able to post to that url an uploaded image and then set the Asset Porperty on the image control to the posted response

Jason Carmen
Posts: 0
Joined: Wed Mar 05, 2014 1:51 pm

Mapping ImageUpload Response Content to Image control from HTML control post

Hi Posting to this url:
http://www.fangatez.com/api/ImageUpload

Response: http://www.fangatez.com/IMAGES/page2-...

I want to be able to post to that url an uploaded image and then set the Asset Porperty on the image control to the posted response

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mapping ImageUpload Response Content to Image control from HTML control post

There is only image URL in response. It's not json or xml. In this case mapping won't work. On service complete event you have to set image asset preAppery("imgName").attr("src", jqXHR.responseText);/pre

Jason Carmen
Posts: 0
Joined: Wed Mar 05, 2014 1:51 pm

Mapping ImageUpload Response Content to Image control from HTML control post

The thing is in order to upload an image you have to use the html control you have no context on the post from the form. Do I need to create some kind of reponse type in my post method?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Mapping ImageUpload Response Content to Image control from HTML control post

Yes, in response you can send json. This way you'll be able to use mapping from response to image asset.

Jason Carmen
Posts: 0
Joined: Wed Mar 05, 2014 1:51 pm

Mapping ImageUpload Response Content to Image control from HTML control post

That does not help me with uploading the image in the first place. How do I upload the image?

Jason Carmen
Posts: 0
Joined: Wed Mar 05, 2014 1:51 pm

Mapping ImageUpload Response Content to Image control from HTML control post

To be more clear I guess what I am saying is that I am trying to allow a user to upload an image I want to take the image they upload post it to my api url and then map the response to a local variable so that I use it later on another screen I have modifed the api repsone to retrun some Json data points

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Mapping ImageUpload Response Content to Image control from HTML control post

Hi Jason,

Please try to walk through this tutorial: http://docs.appery.io/tutorials/uploa...

This is an example of simple application that described in details how to upload the files (including the image).

If you still have problems after passing this tutorial, please post screen shots of your critical application parts.

Return to “Issues”