Skip to main content

I have attachments stored in a SQL table from File Attachment controls. Due to client requirements, I need to extract out those attachements to a downloadable or viewable in excel file format in once time. How can I achieve this in K2? 

 

Or any other possible alternative way to achieve similar result.

 

Thank you.

Hi,


 


Do you mean you want to grab all the files in the table in one go? That is not something that can be achieved out of the box in K2. You can use a SmartObject to list them out in a list view, but you still have to click on each of the record to download the files one by one.


 


You can try writing a script to accomplish this. Your file attachment is stored in the database in the following format:


 


<file>


  <name>test.xslx</name>


  <content>[base64 encode of your file]</content>


</file>


 


In your script, you have to create a loop to loop through each records. Then for each record, parse the XML, grab the file name, decode the content, then save the file under the same file name. 


 


Reply