I am trying to save an attached file from smartform into binary format to my SQL database.
Im not sure if you can save file attachements as binary, but you can save file attachments as nvarchar(MAX) (see nvarchar.png). Type “Text” and “varchar” also seem to work. You can then download the file from a listview which you can put onto a form (see download.png). I assume you already created a advanced smart object and a service instance, if not here is a link on how to do so. Hope this helps.
Thank you for your response.
I am already saving into SQL but the default is based 64, I need to save it to binary as old/legacy application will use it.
Actual value in SQL
<collection><object><fields><field name='FileName'><value>AAAA-000013.xls</value></field><field name='FilePath'><value>70D16121FED732285230A531A26874CA\AAAA-000013.xls</value></field><field name='FileRequestData'><value></value></field><field name='FileDataURL'><value></value></field></fields></object></collection>
I could not find much information on saving it as a binary, even when creating a advanced SMO it does not recognize the binary fields, but you can try and convert it through the “to binary” conversion function in workflows (see toBinary.png), and save/update it into your smartobject/sql as a nvarchar or text field , or maybe convert it in sql (something like these queries).
As per xml, it look K2 store the physical file on inetpub directory. in folder 70D16121FED732285230A531A26874CA
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.