From http://stackoverflow.com/questions/20245859/warning-ftp-login-supplied-resource-is-not-a-valid-ftp-buffer-resource-in