Offline File Transfer In Openfire

I am working on a xmpp client, using Openfire 2.9.2 as server. My question is How can I support offline file transferring?

I only want to do the offline file transferring (like offine message transferring),For example, I can transfer an image to user named as Mahi even he is offline. When Mahi will come back Online, the server will send him the image.

How can I do that? Is there any module for this in Openfire?

Thanks in advance!

AFAIK, it’s not possible out of the box.

One suggestion: You could solve it by uploading the file to a separate HTTP server (or FTP), then send a message to the recipient with the URL to the file.

Once the recipient has downloaded it from the server it can be deleted.

(This is how we solved it).

Maybe you want to also read http://xmpp.org/extensions/xep-0066.html

hello CSH ,

you say that i have to store file in seprate HTTP server but which type of request is made by Android Client to send file to server.

Is it implement inside openfire source or externally we have to implement it ?

We did it externally. Upload is done via REST WebService interface to an external JBoss Server, which stores the files in a data storage (S3).

You could use a HTTP POST request to upload a file, similar to here: http://stackoverflow.com/questions/15968165/uploading-files-and-other-data-from- android-through-http-post-request

In parallel a message is send to the recipient via XMPP. You could use XEP-0066 for the message payload.

The recipient receives the message and can download the file, from the REST WebService, e.g. http://server/{username}/{filename}

The WebService then deletes the file (or automatically after 30 days).

1 Like