add initial support for upload directory
fix a bug described at https://github.com/haiwen/seafile-client/pull/319/files#r21048148