Here is my code snippet what I have for the file transfer:
mFTM=FileTransferManager.getInstanceFor(mConnection);
transfer = mFTM.createOutgoingFileTransfer(user_name.toLowerCase()+"@52.4.53.212"+"/Smack");
try{
transfer.sendFile(newFile(profileImagePath),"file");
}catch(SmackException e){
e.printStackTrace();
}
**Code to receive files:**
mFTM.addFileTransferListener(newFileTransferListener(){
@Override
publicvoid fileTransferRequest(FileTransferRequest request){
if(request!=null){
IncomingFileTransfer intransfer=request.accept();
try{
intransfer.recieveFile();
Log.e("inFile", intransfer.recieveFile()+"");
}catch(SmackException e){
e.printStackTrace();
}catch(XMPPException.XMPPErrorException e){
e.printStackTrace();
}
}
}
});
where mFTM is the instance of FileTransferManager.
Any help in this is appriciated.Thank You