SP へファイル オブジェクト (sp.js)

Web パーツ ページ、ドキュメント ライブラリのアイテム、またはフォルダ内のファイルにすることができる SharePoint Web サイト内のファイルを表します。

**適用対象:**apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

var object = new SP.File()

メンバー

Fileオブジェクトでは、次のメンバーがあります。

Constructor

Fileオブジェクトでは、次のコンスがあります。

コンストラクター

説明

ファイル

Initializes a new instance of the SP.File object.

メソッド

Fileオブジェクトでは、次の方法があります。

メソッド

説明

承認

Approves the file submitted for content approval with the specified comment.

checkIn

Checks the file in to a document library based on the check-in type.

checkOut

Checks out the file from a document library based on the check-out type.

copyTo

Copies the file to the destination URL.

deleteObject

Deletes the File object.

拒否します。

Denies approval for a file that was submitted for content approval.

getContentVerFromTag

Reserved for internal use only. This method exposes the internal ContentVersion value inside of a ContentTag.

getLimitedWebPartManager

Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view.

moveTo

Moves the file to the specified destination URL.

発行します。

Submits the file for content approval with the specified comment.

削除済みデータします。

Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.

saveBinary

undoCheckOut

Reverts an existing checkout for the file.

unPublish

Removes the file from content approval or unpublish a major version.

プロパティ

File オブジェクトには次のプロパティがあります。

プロパティ

説明

作成者

Gets a value that specifies the user who added the file.

checkedOutByUser

Gets a value that returns the user who has checked out the file.

checkInComment

Gets a value that returns the comment used when a document is checked in to a document library.

checkOutType

Gets a value that indicates how the file is checked out of a document library.

contentTag

Returns internal version of content, used to validate document equality for read purposes.

customizedPageStatus

Gets a value that specifies the customization status of the file.

eTag

Gets a value that specifies the ETag value.

存在します。

Gets a value that specifies whether the file exists.

長さ

Gets the size of the file in bytes, excluding the size of any Web Parts that are used in the file.

レベル

Gets a value that specifies the publishing level of the file.

listItemAllFields

Gets a value that specifies the list item field values for the list item corresponding to the file.

lockedByUser

Gets a value that returns the user that owns the current lock on the file.

majorVersion

Gets a value that specifies the major version of the file.

minorVersion

Gets a value that specifies the minor version of the file.

modifiedBy

Gets a value that returns the user who last modified the file.

Gets the name of the file including the extension.

serverRelativeUrl

Gets the relative URL of the file based on the URL for the server.

timeCreated

Gets a value that specifies when the file was created.

timeLastModified

Gets a value that specifies when the file was last modified.

タイトル

Gets a value that specifies the display name of the file.

uiVersion

Gets a value that specifies the implementation-specific version identifier of the file.

uiVersionLabel

Gets a value that specifies the implementation-specific version identifier of the file.

バージョン

Gets a value that returns a collection of file version objects that represent the versions of the file.

他のリソースのエンドポイント

詳細については、ファイルのリソースを参照してください。

エンドポイント URI 構造

http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)

HTTP 要求

このリソースには、次の HTTP コマンドがサポートしています。

書式を削除します。

DELETE http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)

投稿の書式

POST http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)