Rename file prior to uploading to SharePoint?

  • 20 August 2009
  • 1 reply
  • 4 views

Badge +5

Greetings.  I'm attempting to upload a document that is attached to an InfoPath form to a SharePoint document library.  I can use one of the two following approaches:


1.  SmartObject 'Create' method that points to a document library.  Within InfoPath, set my Create.content property equal to my main data source's 'attachment' node.


2.  SharePoint Document event within the workflow.  In the wizard point the XML's 'attachment' node as the file to upload to SharePoint.


In either of these scenarios I need to be able to rename the document (i.e. append a unique field to the end of the name) prior to uploading because I don't want to either overwrite an existing file or have an error thrown stating that the file already exists.  I can do this in blackpearl because I write code to modify the file name prior to upload, but how do I accomplish this in blackpoint?  Thanks.


1 reply

Userlevel 1
Badge +8

In the Sharepoint Document wizard, on the Upload Document Destination there is a field for File Name that is required, could you simply supply the name you wish to use there to give the file a unique name. Though you would have to know the inital file name first and I don't remember how you can get that in InfoPath.

Any alternative scenario may be to upload the document to a temporary location, then use the document wizard to move the document and rename during the move to the final doc lib and have the process clean up the temporary location.

 Hope this helps. 

Reply