Exibindo arquivo pdf no browser
28/01/2013 18:29
def readFromFile = {
def openAgain = new File(params.id+".pdf")
response.setHeader("Content-disposition", "filename=documentos/teste.pdf")
response.outputStream << openAgain.getBytes()
response.outputStream.flush()
retur
<g:link controller="documento" action="readFromFile" id="${doc.path}"
target="_blank">Arquivo</g:link>
http://localhost:8080/Gerdoc/documento/readFromFile/documentos%2F1
def readFromFile = {
def openAgain = new File(params.id+".pdf")
response.setHeader("Content-disposition", "filename=documentos/teste.pdf")
response.outputStream << openAgain.getBytes()
response.outputStream.flush()
return
}
Para se registrar, clique aqui.