vsftpd on ubuntu gives FAIL UPLOAD

The big picture is this: I have an SD card for my camera that uploads my photos over WiFi to a server using ftp. What I want, is to have those photos uploaded to a little ubuntu box I've got. For security, I'm using ftp over ssl (the card doesn't support sftp). The ubuntu box is behind my router so I've got external port 223 routed to the ubuntu's 21.

I followed this page to set up vsftpd on my server, and it's 90% right. I can see (in vsftpd.log) the remote server logging in, and it's creating folders and files, but all the files it creates have zero length and vsftp.log says

 FAIL UPLOAD: Client "199.192.198.3", "/files/2015-06-22/DSC_0009.JPG", 0.00Kbyte/sec

So I read up on ftp and tried adding passive mode into my setup, including mapping the appropriate ports on my router. No love.

Here's my vsftp.conf:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=YES
force_local_logins_ssl=YES
#
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
#
require_ssl_reuse=NO
ssl_ciphers=HIGH
#
pasv_enable=Yes
pasv_max_port=10100
pasv_min_port=10090

and my router has ports 10090:10100 mapped to the ubuntu box.


FTP is one of the most awful protocols you can have the bad luck to deal with. Most gateways implement ftp proxies to be able to redirect FTP traffic to an internal server, because of the complexity of the protocol (it uses one connection to send and receive commands and another to transfer information). Anyway try to upload from a machine in the server same subnet and if it still fails, check permissions.