CSP - Download file, manipulate and return as attachment
Hi All,
It must be the groundhog days but I can't solve something that I know I've done before. I have a legacy CSP page on a version of Cache without JSON and just pure Cache.
I need a CSP page that takes a .xlsx file, manipulates the file (in COS) and then returns a new manipulated file.
My CSP Page gets the file fine, the problem is then returning the response with the new file as an attachment. I don't want to pipe to a new csp page with a different content-type so was sure I can set %response.Headers etc to get the reply stream I want.
So my CSP Page (which contains a lot of CSP tags)
<csp:if condition='$data(%request.MimeData("FileStream",1))'>
blah blah
s sc=##class(something).method(iStream, .oStream)
kill %request.Data ; Wrong!
set %request.Data("STREAMOID",1)= ##class(%CSP.StreamServer).Encrypt(oid) ; Wrong!
So oStream contains the stream of the new attachment, how can I get CSP to serve this up as an attachment?, the above is obviously wrong as I'm resetting the %request.Data but manipulating %response doesn't help me at all.
Anyone remember CSP as I certainly have tried to block it from memory...