Question David Losiewicz · Apr 1, 2020 %CSP.Page - proper way to change ContentType to display text error or return expected pdf content
Question David Losiewicz · Oct 3, 2019 Ensemble SFTP public key authentication -- Best practice for permissions on public/private key files
go to post David Losiewicz · Apr 1, 2020 Thank you for the quick reply. For Clarity.... I should create an OnPreHTTP( ) method that tests my parameter and set the ContentType accordingly. Pseudo code... OnPreHTTP() as %Boolean { set pdfToken=$get(%request.Data("pdfToken",1)) if (pdfToken is valid) set set %response.ContentType="application/pdf" else set %response.ContentType="text/plain" quit 1 } Followers:David has no followers yet.Following:David has not followed anybody yet.Global Masters badges:David has no Global Masters badges yet.
Thank you for the quick reply.
For Clarity....
I should create an OnPreHTTP( ) method that tests my parameter and set the ContentType accordingly.
Pseudo code...
OnPreHTTP() as %Boolean
{
set pdfToken=$get(%request.Data("pdfToken",1))
if (pdfToken is valid) set set %response.ContentType="application/pdf"
else set %response.ContentType="text/plain"
quit 1
}