PDA

View Full Version : Upload/Download to Web Site?




dwm
Jul 16, 2008, 04:41 AM
I would like users of an iPhone app to be able to create text/string content (e.g. recipes, business cards, quotes, etc.) and upload it to a website. This content will reside and be persistent on the iPhone in a database (or something) but the idea would be to share and exchange the content with other iPhone users in a website. Ideally, the content would move back and forth as an XML document.

Downloading an XML document with the iPhone seems straightforward (a HTTP request that returns an XML document and then parsing that document) but I am at a loss on how I can send/upload an XML document to a server from an iPhone.

Any hints on how to do this?

I suppose, I could put together an XML document, wrap it in SOAP (or not), and send it to a web service as a parameter, but I'm hoping there is a much simpler way.



ghayenga
Jul 16, 2008, 08:32 AM
I would like users of an iPhone app to be able to create text/string content (e.g. recipes, business cards, quotes, etc.) and upload it to a website. This content will reside and be persistent on the iPhone in a database (or something) but the idea would be to share and exchange the content with other iPhone users in a website. Ideally, the content would move back and forth as an XML document.

Downloading an XML document with the iPhone seems straightforward (a HTTP request that returns an XML document and then parsing that document) but I am at a loss on how I can send/upload an XML document to a server from an iPhone.

Any hints on how to do this?

I suppose, I could put together an XML document, wrap it in SOAP (or not), and send it to a web service as a parameter, but I'm hoping there is a much simpler way.

Well, if you control the website you can simply do an HTTP Post and send any string you want and have your webserver/CGI process it, XML or key value pairs or whatever. SOAP is only for sites that want to give you an interactive public protocol that anyone can access.

dwm
Jul 16, 2008, 09:03 AM
Yes, I control the server, but I understand there is a 2K limit on POSTs. Since XML elements themselves take up so many characters, I'm afraid that more detailed content could not be uploaded/posted.

firewood
Jul 16, 2008, 12:25 PM
Yes, I control the server, but I understand there is a 2K limit on POSTs. Since XML elements themselves take up so many characters, I'm afraid that more detailed content could not be uploaded/posted.

If you control the server, then you could send up multiple fragments, and have the server agent reassemble, check and forward the completed result to the processing agent.

dwm
Jul 16, 2008, 03:42 PM
If you control the server, then you could send up multiple fragments, and have the server agent reassemble, check and forward the completed result to the processing agent.

Whoa, just went over my programming competence ;) (but a good thought)

ayasin
Jul 16, 2008, 06:57 PM
Whoa, just went over my programming competence ;) (but a good thought)

google muiti-part mime

matthew858
Mar 24, 2009, 12:24 AM
Well, if you control the website you can simply do an HTTP Post and send any string you want and have your webserver/CGI process it, XML or key value pairs or whatever. SOAP is only for sites that want to give you an interactive public protocol that anyone can access.

Sorry to bump this thread, but what do you mean by an HTTP post? I am currently investigating ways to get data off the iPhone (a 30-40 character string) off the iPhone and save it to my web server, but since I'm new to iPhone programming, I'm not sure how to go about it.