1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-22 11:57:34 +00:00

update get file uploaded bytes

This commit is contained in:
lian
2016-08-31 14:34:08 +08:00
committed by lian
parent 06bc49d17b
commit 7a8eb038e2
6 changed files with 74 additions and 29 deletions

View File

@@ -1035,31 +1035,6 @@ def get_group_repos(request, groups):
group_repos.append(r)
return group_repos
def get_file_uploaded_bytes(request, repo_id):
"""
For resumable fileupload
"""
content_type = 'application/json; charset=utf-8'
parent_dir = request.GET.get('parent_dir')
file_name = request.GET.get('file_name')
if not parent_dir or not file_name:
err_msg = _(u'Argument missing')
return HttpResponse(json.dumps({"error": err_msg}), status=400,
content_type=content_type)
repo = get_repo(repo_id)
if not repo:
err_msg = _(u'Library does not exist')
return HttpResponse(json.dumps({"error": err_msg}), status=400,
content_type=content_type)
file_path = os.path.join(parent_dir, file_name)
uploadedBytes = seafile_api.get_upload_tmp_file_offset(repo_id, file_path)
return HttpResponse(json.dumps({"uploadedBytes": uploadedBytes}),
content_type=content_type)
def get_file_upload_url_ul(request, token):
"""Get file upload url in dir upload link.