Upload a file
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with the existing Seafile client class and the documentation referenced in the issue, then compare its file-creation path with the shown requests.post upload example. No specific file or test is named, so first locate the relevant file API entry point. Done means the supported upload approach is identified and documented, or the missing behavior is clearly scoped.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hey,
as far as I understand the documentation and the code of the class itself, no functionality for uploading a file is given.
I am able to connect to a Seafile server and create an empty file with this URL:
file_name = os.path.basename(file_path) file_url = os.path.join(server_url, 'lib', repo_id, 'file', file_name)
Is there a better alternative implemented than using the existing requests library and simply post the file content?
response = requests.post(file_url, files=files, headers=headers)
with
auth_response = requests.post(f"{server_url}api2/auth-token/", data={'username': username, 'password': password})
token = auth_response.json().get('token')
headers = {'Authorization': f'Token {token}'}
files = {'file': (file_name, open(file_path, 'rb'))}
I am happy about any recommendations to some more detailed documentation or a code example.
Later on, I can add the solution to the documentation for following users.
- Ngôn ngữ chính
- Python
- Star
- 40
- Fork
- 47
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của haiwen/python-seafile
-
utils.py has a bugĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 55/100
haiwen/python-seafile#18 ·
-
upload the zip fillesĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
haiwen/python-seafile#15 · 2 bình luận ·
-
Fix access to repo APIĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
haiwen/python-seafile#6 ·
-
Still alive?Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
haiwen/python-seafile#4 · 1 bình luận ·
Tất cả issue của haiwen/python-seafile
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ok-oldking/ok-wuthering-waves#1785 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
healthchecks/healthchecks#1349 ·
-
deployment release-lag
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
nolte/kamerplanter#2374 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/python-sdk#3725 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
batchterms() drops queries without a similar() clause, misaligning results with inputsCó thể đã có người làm @MohammadHijjawi97 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày