downloading and saving attachments from safari

Discussion in 'iOS Programming' started by shweta13, Sep 24, 2008.

  1. shweta13 macrumors member

    Joined:
    Aug 7, 2008
    #1
    Hi all,

    I want to download and store an attachment opened through safari on my iphone. can I do it? If not is there any other way to download and save attachments on iphone?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    You mean from within an application you are writing? This forum is for questions regarding writing software for the iPhone...
     
  3. shweta13 thread starter macrumors member

    Joined:
    Aug 7, 2008
    #3
    Yes,
    I am opening safari thru my application...and I wish to download the attachment given on a particular URL and save it on my iphone...can i do it?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    No. You will have to use the correct APIs to do it yourself. I'd suggest some reading. In particular you will want to use the NSURLConnection class.
     
  5. shweta13 thread starter macrumors member

    Joined:
    Aug 7, 2008
    #5
    I know about NSURLConnection..The thing is...I had read it somewhere that we cannot save the downloaded applications on iPhone...that is the reason I was asking...anyways thanks for the help
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    You didn't say anything about applications. No you cannot download and run code (applications) directly or via Safari.
     
  7. shweta13 thread starter macrumors member

    Joined:
    Aug 7, 2008
    #7
    Does the same apply for the normal attachments also, such as documents,images etc?
     
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    You can download them if you want. You can only write directly to your own application sandbox so they will only be available to your own application.
     
  9. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #9
    If the URL works, you can download and save most anything from an app. You can not run any applications however, downloaded or otherwise, except for maybe ones in plain javascript. Any applications you download will be stuck, unrunnable, inside a sandbox.
     

Share This Page