Compare commits
No commits in common. "8f6e38cb337bcf51b0790f2db7001681ceb9338f" and "5d2e08eabc8186848630f1aa790c72260b9751b0" have entirely different histories.
8f6e38cb33
...
5d2e08eabc
16
Bookstack.py
16
Bookstack.py
@ -62,22 +62,6 @@ def get_attachment(wiki_url, token_id, token_secret, attachment_id):
|
|||||||
return attachment_data_decoded
|
return attachment_data_decoded
|
||||||
|
|
||||||
|
|
||||||
def update_attachment(wiki_url, token_id, token_secret, attachment_id, file_name, file_data, page_id):
|
|
||||||
headers = {}
|
|
||||||
headers.update(get_auth_header(token_id, token_secret))
|
|
||||||
|
|
||||||
data = {}
|
|
||||||
# Workaround for updating files: https://github.com/BookStackApp/BookStack/issues/3666
|
|
||||||
data["_method"] = "PUT"
|
|
||||||
data["name"] = file_name
|
|
||||||
data["uploaded_to"] = page_id
|
|
||||||
|
|
||||||
files = {}
|
|
||||||
files["file"] = file_data
|
|
||||||
|
|
||||||
requests.post(wiki_url + "/api/attachments/{}".format(attachment_id), headers=headers, data=data, files=files)
|
|
||||||
|
|
||||||
|
|
||||||
def delete_attachment(wiki_url, token_id, token_secret, attachment_id):
|
def delete_attachment(wiki_url, token_id, token_secret, attachment_id):
|
||||||
headers = {}
|
headers = {}
|
||||||
headers.update(get_auth_header(token_id, token_secret))
|
headers.update(get_auth_header(token_id, token_secret))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user