Skip to content

Commit

Permalink
downloadFile method. (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
sosguthorpe authored Nov 27, 2019
1 parent 031dcff commit 1d4ca4e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ class FileUploadController extends OkapiTenantAwareController<FileUpload> {

respond fileUpload, [status: CREATED]
}


@Transactional(readOnly=true)
def downloadFile() {
FileUpload fileUpload = fileUploadService.get(params.fileUploadId)
FileUpload fileUpload = FileUpload.read(params.fileUploadId)

render file: fileUpload.fileObject.fileContents.binaryStream, contentType: fileUpload.fileContentType
}
}

0 comments on commit 1d4ca4e

Please sign in to comment.