Endpoint Assembly method returning a file content (byte array or stream string) unable show on view


HI All,

 

I'm using an endpoint assembly to return a file content (byte array or stream string).

 

Unable to map the filecontent to file attachment control.

 

Please help.

 

Method: public static string DownloadFile()


14211i42C63365FC1BD159.png


2 replies

Badge +3

I believe you would need to convert the file to base64 and encapsulate it inside a particular xml object before returning it to K2.
You can search for what the file object looks like, or to find out what this looks like yourself, create a smartobject to link to a DB table you have control over, Set one column in the table to NVARCHAR(max) and the mapped smartobject field to type File and upload a file via this.

You would also need your final smartobject field to be set to type File.

Badge +10
Hi achand

Not exactly the same as what you are trying to achieve, but the following post might have some ideas to point you in the right direction.
https://community.k2.com/t5/General/I-need-to-generate-a-Text-File-from-a-K2-Form-similar-to-the-PDF/m-p/107609#M4381

Reply