views:

513

answers:

1

Hello, What is the simpliest approach to copy files from iPhone to iPhone (p2p).

The only way I can come up is this:

  • Use Bonjour to discover server app (which will advertize itself via Bonjour)

  • Use NSStream (or sockets) and then stream data from the file from peer to peer (read chunk of the file, send chunk of the file and so on until entire file is read)

Is there a APIs/Method which would take care of all streaming data and just copy a file from place to place without doing low lever programming with streams or sockets (similar to http://msdn.microsoft.com/en-us/library/ms740565(VS.85).aspx)?

I guess I can also use GameKit and stream data over establish session, but it seems that Baonjour provides more flexibility.

thanks

A: 

iFiles App (http://itunes.apple.com/us/app/ifiles/id336683524?mt=8) does in other way too, user can transfer files using browser from desktop to iPhone. So they used simple, html,js for this. But if iPhone to iPhone file transfer is considered then its app to app specific communication, which means we need to code it in low level, taking care of streaming and every thing. because in iphone you cannot choose files like desktop :)

Sanniv