In StreamServe, need to send JPEG as Base64 in HTTP response
I have a project in which I need the create a JPEG and return it in HTTP response encoded as base64. The issue is when I generate the JPEG via Storyteller, the file is not available until after the response is sent. I tried to write the JPEG as a variable so I can use Base64EncodeString, but I cannot seem to figure out how to do so. Currently I the external app does 2 passes: one to generate the jpeg file and generate a file to use in an execute function to run "type filename" (where filename is custom for that run); and one to convert to run Base64EncodeFile to convert the JPEG to base64.
I am completely open to finding a better way. Any input would be greatly appreciated.
Comments
-
Template Engine would be your friend here.
You could activate your jpeg creating process and send output to an attachment connector / or use a resource filter.
You can now kick off a Template Engine script that references the attachment / resource (retrieving it in base64) and save the output to a variable.
This variable can then be used in your response.
Personally I like to have a thorough level of control on this kind of operation and would write a micro-service to do it.
Good luck!
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 150 General Questions
- 148 Thrust Services
- 57 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 32 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories