Upload a file
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 40
- フォーク
- 47
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
haiwen/python-seafile のほかの issue
-
utils.py has a bugオープン
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
haiwen/python-seafile#18 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
haiwen/python-seafile#15 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
haiwen/python-seafile#6 ·
-
Still alive?オープン
難易度 1/5 1時間未満 初心者へのやさしさ 15/100
haiwen/python-seafile#4 · コメント 1 件 ·
haiwen/python-seafile の issue をすべて見る
似ている issue
-
`burr` fails to start when the Python path has a space in it対応中かも @enekoreto が今日担当しました。 オープンstatus/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
gemini 出现了新的域名需要加入オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
難易度 2/5 半日 初心者へのやさしさ 72/100
debpalash/VoiceStudio#2903 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dagster-io/community-integrations#367 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
aws-samples/sample-per-model-bedrock#243 ·
メンテナーはふだん 1 日以内に返信