UploadDocument
Uploads a document to a SharePoint document library. Essential for adding new files for collaboration and document management.
Stored Procedure-Specific Information
To execute this procedure, enter:EXEC UploadDocument File='C:\path\to\local_file.txt', Library='Documents', Name='my_file.txt'
Input
| Name | Type | Required | Accepts Input Streams | Description |
| File | String | False | False | The local file path of the document to be uploaded. Example: 'C:/Users/User/Documents/myfile.txt'. |
| FileContent | String | False | False | The Base64-encoded content of the file to be uploaded. If specified, the value of 'File' input will be ignored. |
| Library | String | True | False | The name or relative URL of the SharePoint document library where the file should be uploaded. Example formats: Root directory:Documents Sub-folder:Documents/Subfolder If the URL connection property is set to a site collection, this relative URL corresponds to a path within the base site. If URL points to a specific site, the relative URL will be relative to that site. |
| Name | String | False | False | The filename assigned to the uploaded document. If uploading to the root directory, provide only the filename. If uploading to a subdirectory, prepend the full folder path. Example formats: Root Directory:filename.txt Sub-directory:MyFolder/filename.txt |
| Content | String | False | True | The content as an InputStream to be uploaded when 'File' is not specified. |
| ChunkSize | Int | False | False | Specifies the size in megabytes (MB) of chunks used for multi-part uploads. Useful for large files. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | Indicates whether the file upload operation was successful. |
| Id | String | The unique identifier assigned to the uploaded document in SharePoint. |
| DocumentId | String | The document ID assigned to the file within SharePoint. |
| DocumentIdUrl | String | The direct URL associated with the document ID in SharePoint. |
| FileRef | String | The file reference path in SharePoint after the document is uploaded. |