In my Grails applications, I have a controller function to return a PDF file.
When I make a call to the URL (to return the file), It downloads the file, rather than displaying the PDF file in the browser.
When I open other pdf files from other websites, it displays in browser.. so I think it has something to do with my returned response?
def separator = grailsApplication.config.project.separator.flag
def path = grailsApplication.config.project.images.path+"public/"+user.id+"/"
render(contentType: "multipart/form-data", file: new File(path+note.preview), fileName: note.preview)
Do I need to change the contentType? (I kind of tried to make it /application/pdf but didnt work?..still downloads.