Smack-File transfer : Does file gets stored on the client's machine?

I am new to this smack api. I want to implement file transfer functionality using JWChat , jsp, servlet and smack api.

Code is woking fine but when I try to transfer a file across machines at that time it (file) still gets stored on the server.

Where does exactly incoming file gets stored, on the server or on the client’s machine?

I found that it does store file on the server.

Following is the code.

IncomingFileTransfer transfer = request.accept();

transfer.recieveFile(new File(“C:\”+transfer.getFileName()));

Also I am not getting how to ask receiver whethe he/she wants to accept/reject the incoming file?

Follwing is the code

final FileTransferManager manager = new FileTransferManager(connection);

manager.addFileTransferListener(new FileTransferListener() {

public void fileTransferRequest(FileTransferRequest request) {

//Every one says write here code to check whether receiver wants to accept or reject a file

                // but what should I write here. Please give me sample code

// Accept it

try {

System.out.println(“Receiving”);

IncomingFileTransfer transfer = request.accept();

transfer.recieveFile(new File(“C:\”+transfer.getFileName()));

System.out.println("File Received: "+ transfer.getFileName());

} catch (XMPPException e) {

e.printStackTrace();

}

}

});

Kindly suggest somthing. Thanks in advance.

If you are running this code in a servlet, then the XMPP client is the servlet, not the browser. Therefore the file will of course be stored on the web server.

Thanks for your reply .

I am still confused.

Yes, I am using servlet for sending and receiving file. The file transfer functionality which is present in the Skype, I want to implement similar functionality in my chatting application(Its a web application). Where one X person will send a file to Y person while chatting. Y should be able to accept/reject/download that file.

Should I use smack file transfer api / XMPP? If yes how?

Skype is a desktop app, so don’t expect the same functionality from a servlet.

Since Smack is NOT running in the browser, then it is not of much use to you for doing your file transfer to the client. You may want to look into a browser based solution that has file transfer capability. I don’t actually know if they exist, as writing to the local disc from a browser is typically blocked for security reasons.

Thanks for your help.