Fix. Failed download when specify a file(not a directory).