capabilities.work

Upload a Document and Verify It

A 3-step recipe with Microsoft SharePoint. We can help you get access.

Recipe · 3 steps

Upload a Document and Verify It

Upload a file into a SharePoint document library and verify it downloads.

  1. List the folder before writing. The upload path carries overwrite=true, so this is the caller's only chance to see what an existing file of the same name looks like before it is replaced.
  2. Upload the document as a raw octet-stream. The operation overwrites any file already at this name and returns the created file's metadata, including the server-relative URL used to read it back.
  3. Download the file back from the server-relative URL the upload returned. A 200 here is the proof that the document is stored and retrievable, not merely that the write was accepted.
What you'll need to have ready
  • folderUrl: Server-relative folder URL, e.g. "/sites/mysite/Shared Documents".
  • fileName: File name to write, e.g. "quarterly-report.docx".
  • fileContent: Raw bytes of the file to upload.
For your developer

Arazzo workflow sharepoint:upload-document, 3 operations: getFilesInFolder → uploadFile → downloadFile. Specs on APIs.io.