I have existing folders and files, now I need to read that directory and create file list using same manner in confluence .
for that I need to write a script for file list and to upload an attachment.How it possible with confluence ??
reply me ASAP
Hi!
you can reuse this python module
https://github.com/atlassian-api/atlassian-python-api
Cheers,
Gonchik Tsymzhitov
Hi @Vidya Shevale,
You could tweak this simple python script per your needs too and execute it from your current directory.
import osimport requestsURL = 'http://<confluence-server>/rest/api/content/<page-id>/child/attachment'USERNAME = '<username>'PASSWORD = '<password>'for root, dirs, files in os.walk("."): for filename in files: with open(filename, 'rb') as f: r = requests.post(URL, files={filename: f}, auth=(USERNAME, PASSWORD), headers={'X-Atlassian-Token': 'no-check'}) print(r.json())
Thanks,
Lava
It looks like you're new here. Sign in or register to get started.