Upload/Download to Web Site?

Discussion in 'iOS Programming' started by dwm, Jul 16, 2008.

  1. dwm macrumors newbie

    Jul 19, 2007
    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.
  2. ghayenga macrumors regular

    Jun 18, 2008
    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.
  3. dwm thread starter macrumors newbie

    Jul 19, 2007
    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.
  4. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    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.
  5. dwm thread starter macrumors newbie

    Jul 19, 2007
    Whoa, just went over my programming competence ;) (but a good thought)
  6. ayasin macrumors 6502

    Jun 26, 2008
    google muiti-part mime
  7. matthew858 macrumors member

    Apr 15, 2008
    Sydney, Australia
    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.

Share This Page