diff --git a/app.py b/app.py index 813ed99..4749140 100644 --- a/app.py +++ b/app.py @@ -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/', methods=['GET']) -def downloadFile(objectName): +@app.route('/v1/file/download//', 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)