I am looking to upload a photo from iPhone to a 4D Server. Specifically to upload a photo taken on an iPhone, uploaded to a 4D Server and stored as a JPEG image in the WebFolder. I am using 4D Server version 12 and 13. I have looked at other postings here but I cannot make any of them apply to 4D. Anyone know how to do this?
Share
It took me a while but I finally puzzled together the various procedures to make this work. Thumbs up to the iriphon blog (http://www.iriphon.com/2011/11/09/ios-uploading-an-image-from-your-iphone-to-a-server/) for putting me on the right track.
Here is the iOS code I used:
Don’t forget to include the NSURLConnection delegates!
I used Wireshark, as described in the blog, to get the exact data I needed. I am using NSData to store the photo I had just taken with the camera and want to upload. Because of this my code is slightly different than if you wanted to upload a stored file.
Here is the 4D (version 12) code:
Here is the 4D (version 13) code: