Copy list attachment to document library using REST
문제
Is it possible to copy an attachment on a list item to a document library within the same site using SPD workflows and the REST api?
I have tried using the copyto function, but I cannot get it to work.
I have the relative url of the attachment itself (using another REST call).
All other solutions is off the table, I cannot use any 3rd party solutions or scripting or anything.
BR Morten
해결책
Sometimes getting away and coming back wth fresh eyes is a good thing. I have made it work using the copyto function.
/_api/web/getfilebyserverrelativeurl('folder/filename.txt')/copyto(strnewurl='sites/sitesname/libraryname/filename.txt',boverwrite=false)
I still have an issue to fix though, the file get corrupted and cannot open (Happens on xlsx and docx files - but not txt files) - but that should be possible to fix I'm pretty sure!
제휴하지 않습니다 sharepoint.stackexchange