I try to send a File via xmpp and smack
FileTransferManager manager = new FileTransferManager(
this.xmppConnection);
OutgoingFileTransfer transfer = manager
.createOutgoingFileTransfer(this.jid);
transfer.sendFile(file, "test");
while (!transfer.isDone()) {
LOGGER.info("Uploading File: " + file.getName() + " STATUS: "
+ transfer.getStatus() + " >> progress: " + 100
* transfer.getProgress());
try {
Thread.sleep(100);
} catch (InterruptedException ex) {
LOGGER.error("Exception: " + ex);
}
}
LOGGER.info("File transfer is done: " + file.getName() + " STATUS: "
+ transfer.getStatus() + " >> progress: " + 100
* transfer.getProgress());
LOGGER.info("Amount written: " + transfer.getAmountWritten());
LOGGER.info("Bytes sent: " + transfer.getBytesSent());
LOGGER.info("Peer: " + transfer.getPeer());
LOGGER.info("Error: " + transfer.getError());
LOGGER.info("Exception: ", transfer.getException());
The logs are: Uploading File: image_P9.png STATUS: Initial >> progress: 0.0 Uploading File: image_P9.png STATUS: Negotiating Transfer >> progress: 0.0 File transfer is done: image_P9.png STATUS: Refused >> progress: 0.0 Amount written: -1 Bytes sent: -1 Peer: [email protected]/IM+ Android Error: null Exception:
so I don't get a Error or Exception. The sending is just refused.
My goal is to send an inline-image to any android client.