How to copy document from library to list attachment?

Mar 6, 2014 at 9:30 AM

I need to attach a document that is stored inside a document library to a list item on the same webpage. All needs to be done with javascript / jquery / spservices.

Can you please help me and show me how to do this?

I know, that SPServices has a function called 'AddAttachment', but I dont know how to get the file from the document library and pass it to this function.

Mar 10, 2014 at 11:51 AM
Please, has anyone any suggestion or any hint?
Im really stuck with this...
Mar 10, 2014 at 2:18 PM

I haven't replied because I don't have an example of this. You'd need to read the filestream in base64 to transfer it.

Mar 11, 2014 at 9:06 AM
OK, I understand. Thank you very much anyway!

Do you maybe have an example of how to just get the filestream of a file inside a document library?