UploadDocument
SharePoint ドキュメントライブラリにドキュメントをアップロードします。コラボレーションとストレージのためにSharePoint に新しいファイルを追加するために不可欠です。
Stored Procedure-Specific Information
Examples follow.To upload a file from a local path to a SharePoint library:
/* URL = https://mysite.sharepoint.com */ EXEC UploadDocument RelativeUrl = 'Shared Documents/Cdata/', InputFilePath = 'C:/Users/User/Documents/Demo1234.txt', FileName = 'Demo1234.txt';
To upload a file to the root of a document library:
/* URL = https://mysite.sharepoint.com */ EXEC UploadDocument RelativeUrl = '/Shared Documents/', InputFilePath = 'C:/path/to/file.json', FileName = 'UploadedFile.json';
To upload a file to a subsite's document library:
/* URL = https://mysite.sharepoint.com/sites/TestSite */ EXEC UploadDocument RelativeUrl = '/Shared Documents/Subfolder/', InputFilePath = 'C:/Users/User/Documents/report.pdf', FileName = 'monthly_report.pdf';
To upload large files with chunk upload:
To upload large files, you can activate the chunk upload logic by setting the ChunkSize input to a positive value lower than 250, which is the maximum upload size limit for SharePoint.
- Suggested Chunk Size: SharePoint recommends a chunk size of 10MB.
- Usage Limits: Uploading large files with small chunks may exceed usage limits, causing SharePoint to throttle further requests from that client temporarily.
/* Upload large file with chunk upload */ EXEC UploadDocument RelativeUrl = 'Shared Documents/', InputFilePath = 'C:/Users/User/Documents/large_file.zip', FileName = 'large_file.zip', ChunkSize = '10';
Input
| Name | Type | Required | Description |
| RelativeUrl | String | True | ファイルがアップロードされるフォルダの相対パス。このパスはSharePoint 接続プロパティで指定されたベースURL に基づいています。 例: ルートフォルダ:Shared Documents サブフォルダ:Shared Documents/MyFolder 接続プロパティがサイトコレクションを指している場合、相対URL はベースサイトのパスに対応します。特定のサイトを指している場合、相対URL はそのサイトに対する相対パスになります。 |
| InputFilePath | String | False | SharePoint にアップロードされるファイルのローカルファイルパス。 |
| FileName | String | True | SharePoint で作成されるファイルの名前(ファイル拡張子を含む)。例:'Report.pdf'。 |
| Overwrite | String | False | 同じ名前の既存のファイルを上書きするかどうかを指定するBoolean 値。ファイルが存在する場合に置き換えるには'true' に設定します。 |
| ChunkSize | Int | False | マルチパートアップロードのチャンクサイズ(MB 単位)を定義します。大きなファイルを小さなパーツに分けてアップロードする際に役立ちます。 |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | アップロード操作が成功したかどうかを示します。成功の場合は'true'、失敗の場合は'false' を返します。 |
| Id | String | ファイルが正常にアップロードされた後に返される一意識別子。 |