I'm trying to add attachments from task list to the related list item, I'm using the service _vti_bin/Lists.asmx and the method GetAttachmentCollection , it returns the xml of the attachments from the task form, What I need is to get the base64 binary code from the urls of the attachments so I can use the method AddAttachment , this method takes the parameters:
how can I get the base64 binary from the returned attachment urls??
Solved! Go to Solution.
Hello Omar Taha -
Have you been successful in getting this working? We implemented something similar to this. We developed a webservice that you pass in an URL of the SOURCE document (which may be an item in a doc library or another attachment on an item in a list, just need the URL!) and it returns the base64 and file extension via XML. I then take that, and using the AddAttachment service in lists.asmx, I provide the DESTINATION list name, item id, file extension, and the base64.
For us it is nice because I wrapped it in a UDA so that I can call it where ever I need to. Wrap it in some basic logic and you can grab any item's attachments and do something with it and ignore the items that do not have attachments. There are a lot of uses that we have realized now that we have it in place.
The base64 threw us off for a bit, and there are many different ways to go about getting to it, jut need to figure out what works best for you.
Hope this helps!
I solved the problem in similar way, I first grapped the attachments from
the task form using getAttachemntCollection service, and created a custom
service that takes the url of attachment, and returns the base64 encode of
it, and loop through the attachment collection, and that's works for me.
Thanks for your explaination, I appreciate your help.
Excellent! Glad it works for you and you were able to wrap some logic around it.
Be sure to mark your question as answered so that others can quickly find it... plus it will make Frank Field happy