Skip to content

Commit

Permalink
Merge pull request #2 from KPMP/develop
Browse files Browse the repository at this point in the history
Release v1.0
  • Loading branch information
rlreamy authored Jul 29, 2020
2 parents 0fa4ae7 + 3c10c0f commit 8451adb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
minioUrl = os.environ.get('MINIO_URL')
minioClient = Minio(minioUrl, access_key=minioAccessKey, secret_key=minioSecretKey, secure=False)

@app.route('/v1/file/download/<objectName>', methods=['GET'])
def downloadFile(objectName):
@app.route('/v1/file/download/<packageId>/<objectName>', methods=['GET'])
def downloadFile(packageId, objectName):
try:
object = minioClient.get_object(s3Bucket, objectName, request_headers=None)
objectNameFull = packageId + '/' + objectName
object = minioClient.get_object(s3Bucket, objectNameFull, request_headers=None)
return send_file(object, as_attachment=True, attachment_filename=objectName)
except ResponseError as err:
print(err)
Expand Down

0 comments on commit 8451adb

Please sign in to comment.