Question
View Attachment in new browser tab
Hi all
I would like to be able to default the view of my work attachments in a new browser tab. Currently the OOTBF calls Activity "DisplayAttachFile" this opens the Save File window prompt. I would like to simply open the attachment in a new browser tab without asking to download. Any ideas for a quick win?
Thanks
Mark
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
You need to set the 'Content-Disposition' HTTP Header so that it is not set to 'attachment' :
see https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html
This header when set to 'attachment' will hint to the browser that it should trigger a download - rather than trying to 'inline' the attachment.
The Pega API :
com.pega.pegarules.pub.runtime.PublicAPI.sendFile(byteArray,pdfName,false,null,true);
Has a flag (it's the last argument "aSendForDownload") that controls this header.
So , you need to build your own 'downloader' Activity - that uses this API, with the last flag set to 'false' .