meta data for this page

Download a User's File

Back to JEA API docs

Files that have been uploaded by the user to the JEA service can be downloaded with the auto-generated file ID. A valid JWT token must be included in the header, or the transaction will be rejected with an HTTP 401 Unauthorized error code.


Example using curl://

To download the file with ID command using curl:

curl -b cookies > dn.png

On successful operation, the contents of the requested file is returned. If the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.

Example using Python Requests

Make sure Requests is correctly installed in your Python environment, and run the following the lines:

import requests

# Make a request with the stored cookies from the log on transaction

# Download a previously uploaded file. The example is a png image
r = requests.get('', cookies=cookies, stream=True)

# Write downloaded file content to disk using the given file name
filename = 'dn.png'
with open(filename, 'wb') as fd:
    for chunk in r.iter_content(chunk_size=128):