Have a try!

        response.title = 'Your Document Title'
   response.headers['Content-Type'] = 'application/pdf'
   response.headers['Content-Disposition']='inline'

   return response.stream(<location of PDF file to be streamed>)

I prefer the user to decide what to do (save or view in default browser) by 
        response.title = 'Your Document Title'
   response.headers['Content-Type'] = 'application/pdf'
   response.headers['Content-Disposition']='attachment; filename=
{}.pdf'.format(request.vars.filename) 

   return response.stream(<location of PDF file to be streamed>)

Best regards
Clemens

On Thursday, September 24, 2020 at 4:54:53 PM UTC+2 [email protected] 
wrote:

> Hi,
> i have a controller with this :
> response.headers['Content-Disposition'] = 'inline; filename=%s' % 
> request.vars.filename   
>
> to force streaming the pdf file , and i do not why it does not work ..
> any idea ?
>
> 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a5acb3fc-db71-4a9e-b94a-0ada13caf029n%40googlegroups.com.

Reply via email to