1

I'm using a Mayan EDMS running in a docker container to serve customer documents to my django app. Now I'm kinda stuck at downloading these documents.

I use pythons requests to access the Mayan Api. In my requests I use

auth = HTTPBasicAuth(settings.MAYAN_AUTH_USER, settings.MAYAN_AUTH_PW)
documents = requests.get(url, auth=auth)

to authenticate me. But each document has a full download link which I would like to access directly from the frontend. Is there a way to a authenticate via URL parameter? I wasn't able to find anything mentioning this.

When I'm downloading with requests I get images and pdfs as a byte object without any encoding which I am unable to display in my template.

Roberto Rosario
  • 1,818
  • 1
  • 17
  • 31
Chris
  • 79
  • 1
  • 9

1 Answers1

0

For what its worth it after a couple of years:

Can't you save the byte object to an image/pdf?

I was able to grab the image link and download it with:

image_data = requests.get(image_url,timeout=30)
Bastiaan Wakkie
  • 303
  • 3
  • 9