Recursive File Transfer Task to Sharepoint

37 views
Skip to first unread message

John Nickell

unread,
Jun 11, 2020, 2:31:44 PM6/11/20
to COZYROC
I'm trying to transfer a local "subdirectory" tree to a Sharepoint.  I have it partially working, but am kind of stumped about why the second folder is failing. Full disclosure I am new to both SSIS and CozyROC.

  • Local Directory Root
    • Subdirectory1
      • file a
      • file b
    • Subdirectory2
      • file c
      • file d
  • Sharepoint Directory Root
    • Subdirectory1 (pre-exists)
      • file a (works)
      • file b (works)
    • Subdirectory2  (pre-exists)
      • file c - fail?
      • file d
I'm using a script task that get's a list of the local sub-directories.  This then is passed to a ForEach loop, which is correctly iterating through the local subdirectories.
Inside the foreach loop is a single File Transfer Task.  The "Local" paramenter is set to a User::PathVariable which comes from the foreach loop.  The Remote parameter is a variable that is made of the following functions:
  • RemoteSubDir = REVERSE( LEFT( REVERSE(  @[User::PathFolder]),  FINDSTRING( REVERSE(  @[User::PathFolder]), "\\", 1 )))
    • I'm using this to convert \\servername\folder\sub1\LocalDirectoryRoot\Subdirectory1 to "SubDirectory1"
  • RemotePath = "Shared Documents/DF_Test/StorReports" +  REPLACE( @[User::RemoteSubDir] , "\\", "/" ) + "/"
Watching the variables, I can see no difference in the RemotePath variable as declared for Subdirectory1 and Subdirectrory2 that would should cause this.

Below is the error message I'm getting.

[File Transfer Task] Error: An error occurred with the following error message: "System.Net.WebException: The remote server returned an error: (409) Conflict.
   at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
   at System.Net.WebClient.UploadFile(String address, String method, String fileName)
   at CozyRoc.SharePoint.Connection.SendFile(String #=zZ5EwcXg=, String #=zTFWs0gE=, Boolean #=zW8oUkIk=)
   at CozyRoc.SqlServer.SSIS.FileTransferTask.#=z6FVcsN2snoki(IFtpClient #=zH6wg_AXDSV7o)
   at CozyRoc.SqlServer.SSIS.FileTransferTask.#=zVf2P$epJAxnW(IFtpClient #=zH6wg_AXDSV7o)".


2020-06-11 12_49_56-Sync_Replace_FileUpload (Debugging) - Microsoft Visual Studio.pngThis is the "working" folder"



2020-06-11 13_26_28-Sync_Replace_FileUpload (Debugging) - Microsoft Visual Studio.png  This is the one that will break

Thanks for your thoughts and input!


Ivan Peev

unread,
Jun 11, 2020, 5:47:32 PM6/11/20
to COZYROC
Hi John,

COZYROC File Transfer Task doesn't support recursive directory upload at the moment.

John Nickell

unread,
Jun 11, 2020, 8:17:52 PM6/11/20
to COZYROC
I'm not doing recursion with the File Transfer Task.  I'm using the For Each loop to "give" the File transfer task a directory. Then it gives it another directory and just the files in that directory.  

John Nickell

unread,
Jun 16, 2020, 11:43:35 AM6/16/20
to COZYROC
Following up here after working with support. 

The issue was with the properties of the Sharepoint Connection Manager I was using.  The default setting for this connection manager for "RetainSameConnection" is true.  This needed to be set to false for my foreach loop to work.  

Thanks to Bobby on the support team for identifying the issue.
Reply all
Reply to author
Forward
0 new messages