A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearCreating a PHP Webservice with binary-encoded parameters? - page 1
User InfoPosts
Creating a PHP Webservice with binary-encoded parameters?#1
I(m trying to build a PHP webservice for an iPhone project I(m developing. I need to be able to send an image (picture) to the webservice, where I(ll then store this in a database. I also need to write a service that will, of course, return this data when requested.

I(m not sure where to start though. I(ve (googled( for how I can build such a webservice but can find no good example of how this can be done. Does anyone have a code example or a url to a tutorial that might help?



posted date: 2009-04-15 14:26:00

Re: Creating a PHP Webservice with binary-encoded parameters?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-15 14:26:01

Re: Creating a PHP Webservice with binary-encoded parameters?#3
I don(t know about the iPhone end of things, but the XML Schema Definition provides support for Base64 encoded data (and Hex encoded data) that will allow you to transport the image info over the Soap protocol.http://www.w3.org/TR/xmlschema11-2/#base64Binaryhttp://us2.php.net/manual/en/class.soapserver.php

posted date: 2009-04-15 14:45:00

Re: Creating a PHP Webservice with binary-encoded parameters?#4
What you need to do is create a form processing script on your webserver, that will receive a "POST" from the iphone client. A simple example of doing this is available at http://www.w3schools.com/PHP/php_file_upload.asp using purely PHP.However because you have the iphone as the client you might want to use the NSMutableURLRequest object to "POST" the image to the script that you have already setup on the server. You don(t specify where the image is coming from, but you probably want to read this:http://iphone.zcentric.com/2008/08/29/post-a-uiimage-to-the-web/

posted date: 2009-04-15 22:00:00

Re: Creating a PHP Webservice with binary-encoded parameters?#5
As fret says, you need to build an HTTP POST request with the image data in a POST form.I highly recommend All Seeing eye(s ASIHTTPRequest framework for building the form. Specifically you want to use the ASIFormDataRequest class. You can retrieve the binary information from a UIImage using (for example) NSData *UIImageJPEGRepresentation(UIImage *image, CGFloat compressionQuality); and add this to the ASHFormDataRequest by sending an instance a -(void)setData:(NSData *)data forKey:(NSString *)key message

posted date: 2009-04-15 22:59:00

select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.