i want render or download url links pdf in grails controller method. i'm okay either opening in new or same tab, or downloading it. how done in grails?
so far have:
render(url: "http://test.com/my.pdf") however, errors , other ways i've tried, such rendering response content. clues?
one option is
class examplecontroller { def download() { redirect(url: "http://www.pdf995.com/samples/pdf.pdf") } } going localhost:8080/appname/example/download will, depending on users browser preferences, either download file or open file in same tab reading.
i works grails 2.5.0
Comments
Post a Comment