Skip to main content

My database admin is using an input value of varbinary(max) so I can upload attachments to our SQL database.  When I create the smartobject, I can see all of the inputs with the exception of varbinary.  Can K2 use that data type?  


Hi


You will have to modify the smartobject either using the K2 designer or visual studio to change the data type of the 'ActualFile' Property to 'File'. I have found from my experience that when you add attachments using the K2 file control, it encodes the file using base64 and stores the file in the following xml format.


<file><name>example.txt</name><content>base64encodedfilecontent</content></file>


This is how its stored when you set the datatype as nvarchar(max). When you use varbinary, I am guessing its converted to binary so it wouldn't be readable to you if you were to query the database for file names for whatever reason but it should still work with the K2 file upload control.


Thanks


 


When the smartobject is created, it doesn't pull in the ActualFile (varbinary) as a variable.   It will only pull in the requestID and Filename.


Even when I browse to the ServiceObject explorer to the stored procedure, it only shows the those two properties.  


In that case, you might have to change the file filed to nvarchar(max) for the service object to expose it. If you really want to use varbinary then you can write a visual studio service object project to access the database table.  


Reply