Hello all,
I have intergrated smack(version 3.1) API for gmail in my project.Intially i was not supporting file transfers but now I am planing to implement file transfers(send and receive) . Receving a file works fine but the problem is when I send file to friends. It is mentioned that in Smack version 3.2 the file tranfer problem is fixed( i didnt check)…since I have intergrated version 3.1 I want to know if there are any possible way to fix this issue in Smack version 3.1 itself…Please find the code below that I use to send file .
//ftMan – file transfer manager instance
FileTransferNegotiator.setServiceEnabled(util.connection, true);
OutgoingFileTransfer oft = ftMan.createOutgoingFileTransfer("ucanmailmi@gmail.com/Smack");
if(oft != null)
{
oft.sendFile(new File("./Decod.java"), “Test transfer!”);
while (!oft.isDone())
{
if (oft.getStatus().equals(FileTransfer.Status.error))
{
System.out.println("ERROR!!! " + oft.getError());
oft.cancel();
}
System.out.println(oft.getStatus());
System.out.println(oft.getProgress());
System.out.println(“5 sec sleep”);
Thread.sleep(15000);
}
if (oft.getStatus().equals(FileTransfer.Status.complete))
{
System.out.println(“Transfer done”);
}
if (oft.getStatus().equals(FileTransfer.Status.error))
System.out.println("Transfer failed: " + oft.getError());
Output: Transfer Failed.
Please let me know the solution.thanks in advance.
errors.log.zip (18008 Bytes)
warn.log.zip (1836 Bytes)