Best way to turn iPhone into file server?

Discussion in 'iPhone/iPad Programming' started by ranguvar, Jul 30, 2010.

  1. macrumors 6502

    Joined:
    Sep 18, 2009
    #1
    Hi,

    I'd like to write an app that turns the iPhone into a file server (basically, the app should replicate the USB drive functionality that Apple unfortunately doesn't allow). The app should not require any additional software on the computer side. It should require a WiFi connection of both iPhone and computer on the same network. It should not run over the internet (for security reasons). I am currently at the very beginning of my project. So far, here's what I thought about:

    - as Apple actively discourages the use of FTP/SFTP/AFP, running a lightweight HTTP server (like moongoose or lighttpd) on the iPhone seems like a good alternative. (What about WebDAV?)
    - upon launch, the app gives the user a URL that the user can visit from his computer using his browser. All the communication is done over TLS.
    - the user uploads and downloads files to / from the iPhone via an OS-independent webpage served by the iPhone.
    - when the app closes, the HTTP server is obviously quit.


    What do you think about this approach?

    -- ranguvar


    EDIT: Some people have experienced difficulties understanding that I'm not looking for an existing app with the functionality I described, which obviously already exists (hence the forum section I'm posting this in), that I don't do this to earn money but that I'd like to develop the app I describe for learning purposes.
     
  2. macrumors 68020

    steviem

    Joined:
    May 26, 2006
    Location:
    New York, Baby!
    #2
    I'm pretty sure this has already been done.

    It's probably somewhere in Cydia, and to be honest, I doubt Apple would approve an app like this.
     
  3. thread starter macrumors 6502

    Joined:
    Sep 18, 2009
    #3
    I want to do it again, then.

    Why would Apple not approve this? And even if so, I don't care, I'm much more interested in learning and getting it to work than putting it in a store.
     
  4. macrumors 6502

    Joined:
    Jan 13, 2008
    #4
    [app]Air Sharing[/app]?
     
  5. thread starter macrumors 6502

    Joined:
    Sep 18, 2009
    #5
    I don't want to buy this app. I want to make an app myself. I don't necessarily want to sell it, I don't do this for money. What I care about is learning and understanding the various components and finally bringing it all together with code.
     
  6. macrumors 68020

    steviem

    Joined:
    May 26, 2006
    Location:
    New York, Baby!
    #6
    Then if this is purely an academic pursuit. perhaps, using bonjour with WebDAV would be friendlier than specifying an IP address.

    Do you want the data available to the phone or do you want to use it almost like a USB flash drive, where only things connecting to it access the data? Similar to the USB drive sharing.
     
  7. thread starter macrumors 6502

    Joined:
    Sep 18, 2009
    #7
    No, I don't plan on adding viewing support for all kinds of files (e.g. Office files). Maybe I'll try and include launch URLs for other apps that are designed to view e.g. Office files.

    Other than that, I aim primarily at making it a lot like USB drive sharing.
     
  8. macrumors 68020

    steviem

    Joined:
    May 26, 2006
    Location:
    New York, Baby!
    #8
    Then I definitely think from a user's perspective, you'll want this:

    - Start the app on the iPhone
    - Click on the Finder, you see it in your sidebar
    - You can drag/drop items and can see the amount of capacity for storage available

    What would be neat, would be either a settings entry on the iPhone for the application where you can specify the password you wish to use and have a slider to specify the space available to the app. Maybe even putting a write protect switch in the app if you want the data to only be readable on the computer it's connecting to.

    How's that for a start?
     
  9. thread starter macrumors 6502

    Joined:
    Sep 18, 2009
    #9
    Sounds good. I guess the hardest part will be to setup the HTTP server (I just read a bit on Bonjour & WebDAV, the need for a Bonjour installation makes this a no-go). The whole network stuff is an area that I've never dabbled in before, I wonder how far I'll come :p
     

Share This Page