New answers tagged

0

I've recently had the same need. Unfortunately, I think there's no way to create a new document using REST, because you actually have to UPLOAD something. In my solution, I made a copy of the template and uploaded it to the library. var templateString = 'yourSite/pathToTemplate/templateName.docx'; var newDocString = ...


0

Folks figured out my issue. The problem was the location of the file. This code worked: var attInfo = new AttachmentCreationInformation(); attInfo.FileName = StringFile.DestinationFileName; attInfo.ContentStream = new MemoryStream(System.IO.File.ReadAllBytes(StringFile.FileAtDestinationPath)); Attachment att = item.AttachmentFiles.Add(attInfo); ...



Top 50 recent answers are included