Skip to main content

Hi !

 

I created a K2 smartform with a file attachement control. When I submit the form, a smartobject uploads the file to a SharePoint library.

 

I would like to change the filename before the upload to SharePoint to remove forbidden character.

 

Couldn't find a way to do this, yet.

 

How can I do this ?

 

Thanks

 

Hi,


 


Since you are using SharePoint, you could use the K2 for SharePoint Web Designer to design a workflow to do this, using the Update Document Wizard might achieve this.


 


Regards.


I would put in a data lable and hide it.  Call the datalable: FileName and use that data lable when your updating your library.

 

If you have one or two simple characters that you'd like to remove, I would just use an Expression against the data lable.  Something like Replace (File Name, <forbidden char>, (Empty String)).  If you have many forbidden characters, I would just add a few more of those replacment expressions to the mix.

14754i56BF10A13A584212.png


Hi,

 

Thanks for your posts. I tried a solution similar to the Expression one you mentionned. I managed to get a clean filename, but I'm stuck when I need to save the file to SharePoint, because I can't give a specific filename to the smartobject which does actual the upload.

The smartobject always tries to save the file under its original (unclean) filename.

 

I don't understand the solution with the K2 For SharePoint Web Designer, because in order to rename the file's name, it would need to be already saved, but it can't, because of the forbidden characters.

 

I hope explained it well.


I've had a few issues in the past when trying to save attchments to SharePoint....I will commonly now just build a SmartBox service just for attachments.

 

Can you upload a screen shot of your Create rule that uploads the image to sharepoint?  Also, if possible show the details of it's configure.


Hi,

 

Thanks for your replies, and sorry for the delay.

 

Attached are some picture of what I did.

 

"CreateFile_SmartObject.png" shows the configuration of the smartobject call

"CreateFile_Trick.png" shows the file field, and some data label used to clean the filename (used the trick described here http://help.k2.com/kb001301). Just below the field, we can see the filename which has been cleansed.

"CreateFile_Error.png" show the error I get when I try to save the file.

 

Unfortunately, for now I cannot build my own Service Object.


12262i5D8E79F996FD09B7.png
13036i6CE7D05E4D9FB758.png
14966iA424183CA6C203DB.png

Reply