please follow this http://developer.android.com/guide/topics/connectivity/wifip2p.html.
That allows you to discover devices on wifi with you, then send data to them via normal sockets.
There is a wifi-direct sample app with the SDK.
please use this code to attach file with intent
File sd = Environment.getExternalStorageDirectory();
File fileDir= new File(sd, "dir_path");
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileDir.getAbsolutePath() + "/"
+ FILE_TXT
intent.setAction("set_your_Action_here");
sendBroadcast(intent);// broadcast your text file.