How to copy document from library to list attachment?

Mar 6, 2014 at 8:30 AM
Hi!

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.

Thanks!
Mar 10, 2014 at 10:51 AM
Please, has anyone any suggestion or any hint?
Im really stuck with this...
Coordinator
Mar 10, 2014 at 1:18 PM
MartiniMoe:

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.

M.
Mar 11, 2014 at 8: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?