File Transfer support is available since Gajim 0.8. It is implemented by socks5 bytestreams (XEP-0065 and XEP-0096. For information on file transfer over Jingle see: Jingle File Transfer.
The main objective is to provide a way of exchanging files between users over a stream independent of the XMPP servers, thus saving their resources.
The way it works
First of all, the initiator sends a request for a new file transfer, then the recipient of the file should send its response (accept/deny) to the initiator.
In the next step the initiator of the file transfer (sender) posts an iq with its own IP and a list of socks5 proxy servers. Then the recipient tries to establish a direct p2p connection to the sender. If it turns out to be impossible to establish a direct p2p connection, the recipient tries to connect to one of the socks5 proxies he got from the sender. If it succeeds, it notifies the sender about the proxy being used, and the file transfer can begin.
During the file transfer it is possible that the connection to the peer or the socks5 proxy is lost, or one of the peers cancels the transfer. In these cases both peers should be notified that the file transfer cannot be completed.
Possible problems and solutions
Until the date of writing this wiki, all socks5 proxy servers suffered from one problem:
It is impossible to send a file over socks5 proxy, if one of the peers contains non ascii characters in his jid or resource. In this case the contact that has a jid or resource containing non ascii characters should change it and relogin to his server. Only after that the transfer can be instantiated.
File transfer port (7777) can be filtered by your ISP:
You can check for filtering by typing one of the following commands:
If a connection cannot be established to any of the hosts then your computer is probably behind a firewall filtering port 7777. You can ask your ISP to open the port to the specific proxies that Gajim uses or you can try to find a proxy that listens on a different port than 7777.
If you are behind NAT but you have access to your router, you can forward the port so that your computer is accessible through the translated port on your router. Let's say your internal IP address is 10.10.10.1 and your router's real IP 126.96.36.199, then all you have to do is tell the router to forward all connections to 188.8.131.52 on port 28011 to 10.10.10.1:28011.
After that open Advanced Configuration Editor and change the value of the key named "ft_override_host_to_send" to your real IP address (184.108.40.206), or if you have to the Hostname of your Dynamic DNS-Account.
Sample port forward
Sample port forward from 220.127.116.11:28011 to 10.10.10.1:28011 using iptables: