cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Get Base64 Code From List Attachments

There are multiple posts regarding copying list attachments to another list but how do we get the Base64 for each attachments of a item in a list? 

Labels: (1)
0 Kudos
Reply
9 Replies
Highlighted
Nintex Employee
Nintex Employee

Re: Get Base64 Code From List Attachments

Hi,
Did this post not help?
https://community.nintex.com/t5/Nintex-for-SharePoint/Copy-list-item-from-one-site-to-another-includ...

I'll breifly step through it and explain.
The user has 2 lists and an interim document library.
The document library is the key to answering your question.
He coppies all the attachments to the document library and this creates individual items for each attachment.

The reasosn the document library is required is because he uses SharePoints Lists.asmx web service with the AddAttachments Method on the file in the document library.
In this method when you specify the file as <m:attachment>[FileData]</m:attachment> The [FileData] automatically converts the file into Base64. This can only be done from a document library and that is why its required as an interim step.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

Thank you Simon,
I am able to copy documents/attachments from one place to another but i just want the base64 code.
I am trying to send documents/attachments to a SQL server which only accepts base64.
Thank you!
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

Vadim coded this a few years back, I often use his code. I suggest you have a look : http://www.vadimtabakman.com/nintex-workflow-get-list-item-attachment-in-base64-custom-action-happy-...
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

@allan 

I keep getting below error while using Vadims solution, and i am able to get the URL's properly. I must be missing something:

Error Getting List Item Attachment. Object reference not set to an instance of an object.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

Could you screenshot your action settings ?

Did you install the WSP without error ?

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

Yes,

There is no error on the solution.

FYI: I am not using a task list, just a regular custom list

Snag_5657a737.png

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

@allan @SimonMuntz 

Finally got it after MULTIPLE tests...

The problem was with the internal list name MUST MATCH the list title. In my case the internal list name was ValidationTest and my list title was Validation Test. Finally after several failures i changed the list title to match the internal list name as ValidationTest and it worked!! Thank you for even trying to help me out, your guys are awesome!

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

Glad to hear that.
I suppose that Vadim is using the list URL and the list title with the same variable for both cases.
(there's no internal name for list ;) )

Reply
Highlighted
Nintex Newbie

Re: Get Base64 Code From List Attachments

Yes, @allan is right. If you use the Vadim action to get file Base64, your list Title must match the list URL. 

In the code of this action (I have decompile the dll of the wsp), the URL of the list is re-build with the title, so if you have space or rename your list after his creation, this will not work.

Reply