ADO.NET Provider for Microsoft SharePoint

Build 25.0.9540

DownloadAttachment

SharePoint リストアイテムから添付ファイルをダウンロードします。ユーザーが重要なファイルにアクセスして取得できるようにします。

Stored Procedure-Specific Information

The DownloadAttachment stored procedure downloads an attachment from a SharePoint list item. You can save the attachment to a local file using the File parameter, or retrieve the content as base64-encoded data using the FileData output.

To download an attachment to a local file, enter:

EXEC DownloadAttachment File = 'C:\path\to\DownloadAttachment.txt', RemoteFile = 'https://mysite.sharepoint.com/testsite/Lists/testlist/Attachments/1/test.txt';

To retrieve the attachment content as base64-encoded data, omit the File parameter:

EXEC DownloadAttachment RemoteFile = 'https://mysite.sharepoint.com/testsite/Lists/testlist/Attachments/1/test.txt';

Input

Name Type Required Accepts Output Streams Description
File String False False ダウンロードした添付ファイルを保存するローカルパスで、新しいファイル名を含みます。例:'C:/Users/User/Desktop/Attachment.pdf'。
RemoteFile String True False SharePoint サーバー上の添付ファイルのパス。これは完全なURL('https://yoursharepointsite.com/Shared Documents/attachment.pdf' など)でも、単にファイル名でもかまいません。名前のみが指定された場合、最新バージョンがダウンロードされます。
FileStream String False True ダウンロードされた添付ファイルを書き込むためのOutputStream。これはFile が指定されていない場合にのみ使用されます。

Result Set Columns

Name Type Description
Success Boolean ダウンロード操作が成功したかどうかを示します。成功した場合は'true' を、失敗した場合は'false' を返します。
FileData String ダウンロードした添付ファイルのBASE64 エンコードされたコンテンツ。これは、File とFileStream が指定されていない場合にのみ返されます。

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 25.0.9540