Upload/Download to Web Site?

Discussion in 'iPhone/iPad Programming' started by dwm, Jul 16, 2008.

  1. dwm
    macrumors newbie

    Joined:
    Jul 19, 2007
    #1
    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. macrumors regular

    Joined:
    Jun 18, 2008
    #2
    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

    Joined:
    Jul 19, 2007
    #3
    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. macrumors 603

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #4
    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

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

    Joined:
    Jun 26, 2008
    #6
    google muiti-part mime
     
  7. macrumors member

    Joined:
    Apr 15, 2008
    Location:
    Sydney, Australia
    #7
    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