Upload File to SmartObject from workflow in K2 Studio

  • 31 March 2015
  • 1 reply
  • 6 views

Badge +6

Hi -

 

Stupid question here but I can't seem to figure it out.  I have a SmO that accepts a data type of file.  When using the SmartObject services tester I am able to browse and select a file and it will upload to the SmartObject successfully.

 

However, from a worfklow, I am having some trouble understanding how to do this.  Basically, I want to retrieve a file from SharePoint or from a file system and upload that to the SmartObject.  When I use those inline functions, the smartobject triggers an invalid base-64 string error.  Can someone talk me through the best way to accomplish this using K2 Studio?

 

I also tried retreiving the file to a datafield, and then converting that resulting string to a bytes file using the ToBytes function.  While this will allow me to upload the file to the smartobject, it uploads it as a binary file.  I need it uploaded as the original file and format.


1 reply

Badge +5

Since SharePoint is an option, can you push the file to SharePoint with an inline function then use a SmartObject method to get it into the SMO?

 

You can use a Save or a Create method to get the file into the SMO from SharePoint, the input of the SMO will be a GetDocument SmartObject method from SharePoint. Drill down on the Document in the SmartObject method and use the Document Content as the content for your SMO and the Filename as your filename for your SMO. 

 

That should work well for you. I'm not sure about getting the document directly from a file share into the SMO though but it can be moved in from SharePoint. 

Reply