Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ranguvar

macrumors 6502
Original poster
Sep 18, 2009
318
2
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.
 
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.
 
I'm pretty sure this has already been done.

I want to do it again, then.

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

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.
 
[app]Air Sharing[/app]?

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.
 
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.
 
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.

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.
 
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?
 
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?

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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.