Pergunta

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

Foi útil?

Solução

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!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top