I need to place a button which opens an online PDF and so far I have this
in reg.py controller
def streamable():
data = urllib2.urlopen("http://www.pdf995.com/samples/pdf.pdf")
return response.stream(data, 4096)
And this in the view
{{=A('open file', _class="btn btn-sm", _href=URL('reg', 'streamable'))}}
Although this only gives me stream output so a bunch of characters and not
actual pdf, anyone knows how to fix this?
Thank you!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.