title: Grails - Displaying PDF in browser rather than downloading
body: <p>In my Grails applications, I have a controller function to return a PDF file.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Do I need to change the contentType? (I kind of tried to make it /application/pdf but didnt work?..still downloads.</p>