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?
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?
Hello!
Could you clarify where do you post and what you have in response from service?
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
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
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
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?
Yes, in response you can send json. This way you'll be able to use mapping from response to image asset.
That does not help me with uploading the image in the first place. How do I upload the image?
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
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.