Core2
Novice

Download files from Database

Hello all,

 

I would like to store documents, (i.e., .docx, .xlsx, .txt, etc), into a SQL table and allow the user to download the files from the k2 web app by clicking a link in the list view.  My attempts to do this have failed.  Below explains what i have done up to this point.  Also note worthy i don't want a user to upload any files.

 

My table structure:

7144i5F22767511C1E7BD.png

 

Help would be most appreciated.  

0 Kudos
Reply
2 Replies
Perc
Novice

Re: Download files from Database

Hi Core 2, 


 


I have seen the following blog post in regards to this error, it doesn't seem to be a K2 error but more of an error based on SQL. Please have at following post below:


 


https://www.codeproject.com/Questions/296703/String-or-binary-data-would-be-truncated-The-state


 


It could be the case the case the datatype size does match with the database field attributes, so one way to go would be to increase the datatype size on the DB side. 


 


Do let me know if this helps.


 


Kind regards, 


 


Percy

0 Kudos
Reply
khanh1
Novice

Re: Download files from Database

Hi,


 


SQL Server Service doesn't support the VarBinary datatype, see link below. You might want to change to nvarchar(max).


Considerations section:


https://help.k2.com/onlinehelp/k2five/userguide/5.2/default.htm#ServiceBrokers/SQLServer/SQL-Server-...


 

0 Kudos
Reply