Expand "~" to home path
Add file upload support to the commandline, using the same technique as openphoto-php