How to get the file obect in a service broker

  • 22 February 2016
  • 1 reply
  • 6 views

Badge

Hello together

 

actually I' am trying to get the file object, which was attached to the "File Attachment" control. The "File Attachment" controls generates the following XML. 

 

<collection><object><fields><field name='FileName'><value>New Text Document.txt</value></field><field name='FilePath'><value>omuxoni5.nz5New Text Document.txt</value></field><field name='FileRequestData'><value></value></field></fields></object></collection>

 

What is the regular approach to get the file object inside a Service Broker by using C#? 

 

Thanks for your help, 

Moritz Mars

 


1 reply

Badge +3

Your particular scenario is not totally clear to me, but let me point you to some very useful documentation to give you overall understanding and some related source code.

 

https://www.k2.com/onlinehelp/k2blackpearl/devref/4.6.9/default.htm#Working_with_SmartObjects_Updload_File.html?Highlight=base64 -encoded

 

It reveals a little bit about what a Blackpearl SmartForm would be doing for you, and what you must do to deal with the SmartObject "file" data type. To highlight the key point: the binary data is base64 encoded on the way into the Blackpearl environment, and a few attributes (like filename) are expected to be set as object properties.

 

So your service broker would probably need to convert back from base64, and mind the properties of the file object for details like filename.

 

I recommend some exploration of the Developer Reference at https://www.k2.com/onlinehelp/k2blackpearl/devref/4.6.9/Default.htm  . Very helpful, although not comprehensive. It is searchable too.

Good luck,

 - Justin

Reply