ange-ftp-gateway-tmp-name-template is a variable defined in `ange-ftp.el'.
Its value is

Template used to create temporary files when FTP-ing through a gateway.

Files starting with this prefix need to be accessible from BOTH the local
machine and the gateway machine, and need to have the SAME name on both
machines, that is, /tmp is probably NOT what you want, since that is rarely

You can customize this variable.