ericllucas
Nintex Newbie

Migrate documents from a library to a list using Lists.asmx - files are corrupted

Hi:  SharePoint/Nintex 2010

There are similar posts to this topic. I've studied them all and thanks to all for your hard work, I've learned much from them.  What I've got here has only been possible because of your prior work.

 

I am migrating documents from a Document Library to a List. I am using a Web Service and calling Lists.asmx using the AddAttachment method.  It works great, oh, except for the fact that all of the documents are corrupt in the receiving List. 

 

It all comes down to this line in the XML:

      <m:attachment>base64Binary</m:attachment>

 

This line tells the service everything is in base64, I presume, which is most certainly is not.  That results in the files being corrupted as they are migrated.  Here are my choices as I understand them:

 

  1. Install that piece of code on the server that converts things to Base64 - that is not possible in my installation, sorry;
  2. Use <m:attachment>FileData</m:attachment> - This results in corrupt data, as well;
  3. Use <m:attachment>[FileData]</m:attachment> - This results in an error - "Failed to invoke web service. Object reference not set to an instance of an object."  I can only surmise that it thinks [FileData] is a variable.

 

I've scoured Microsoft Docs for other values I might insert in between <m:attachment> and </m:attachment>.  I've come up with nothing.

 

Here is where I am reaching out for help - What options do I have?  How do I migrate those files?  Are there other values I can try?  base32Binary?  base16Binary? What do you suggest?

 

Thanks a bunch!

0 Kudos
Reply
1 Reply
Warwick
Nintex Newbie

Re: Migrate documents from a library to a list using Lists.asmx - files are corrupted

what you've stated above should work, below screen shot works for me in SharePoint 2016 using the same webservice.

 

The workflow runs on each document, passing into it the list name and id to attach to

 

Warwick_0-1604281055079.png

 

0 Kudos
Reply