Class File

Represents a file in a SharePoint Web site that can be a Web Part Page, an item in a document library, or a file in a folder.

Hierarchy

Index

Methods

Methods

public approve(comment: string)

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

Parameters

  • comment: string

public checkIn(comment: string, checkInType: CheckinType)

Parameters

public checkOut()

public copyTo(strNewUrl: string, bOverWrite: boolean)

Parameters

  • strNewUrl: string
  • bOverWrite: boolean

public customFromJson(initValue: any): boolean

Parameters

  • initValue: any

Returns

boolean

public deleteObject()

public deny(comment: string)

Denies the file submitted for content approval.

Parameters

  • comment: string

public fromJson(initValue: any)

Parameters

  • initValue: any

public static getContentVerFromTag(context: ClientRuntimeContext, contentTag: string): IntResult

Parameters

Returns

IntResult

public getLimitedWebPartManager(scope: PersonalizationScope): LimitedWebPartManager

Parameters

Returns

LimitedWebPartManager

public get_author(): User

Returns

User

public get_checkInComment(): string

Returns the comment that was specified when the document was checked into the document library.

Returns

string

public get_checkOutType(): CheckOutType

The type of checkout that exists on the document.

Returns

CheckOutType

public get_checkedOutByUser(): User

Returns the user who has checked out the file.

Returns

User

public get_contentTag(): string

Returns

string

public get_context(): ClientRuntimeContext

Returns

ClientRuntimeContext

public get_customizedPageStatus(): CustomizedPageStatus

Gets the customization(ghost) status of the SPFile.

Returns

CustomizedPageStatus

public get_eTag(): string

Gets the ETag of the file

Returns

string

public get_exists(): boolean

Specifies whether the file exists

Returns

boolean

public get_length(): number

Returns

number

public get_level(): FileLevel

Returns

FileLevel

public get_listItemAllFields(): ListItem

Specifies the SPListItem corresponding to this file if this file belongs to a doclib. Values for all fields are returned also.

Returns

ListItem

public get_lockedByUser(): User

Returns the user that owns the current lock on the file. MUST return null if there is no lock.

Returns

User

public get_majorVersion(): number

Specifies the major version of the file.

Returns

number

public get_minorVersion(): number

Specifies the minor version of the file.

Returns

number

public get_modifiedBy(): User

Returns

User

public get_name(): string

Returns

string

public get_objectVersion(): string

Returns

string

public get_path(): ObjectPath

Returns

ObjectPath

public get_serverObjectIsNull(): boolean

Returns

boolean

public get_serverRelativeUrl(): string

Returns

string

public get_timeCreated(): Date

Specifies when the file was created.

Returns

Date

public get_timeLastModified(): Date

Specifies when the file was created.

Returns

Date

public get_title(): string

Returns

string

public get_typedObject(): ClientObject

Returns

ClientObject

public get_uIVersion(): number

Specifies the implementation-specific version identifier of the file.

Returns

number

public get_uIVersionLabel(): string

Specifies the implementation-specific version identifier of the file.

Returns

string

public get_versions(): FileVersionCollection

Returns a collection of file version objects that represent the versions of the file.

Returns

FileVersionCollection

public isObjectPropertyInstantiated(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public isPropertyAvailable(propertyName: string): boolean

Parameters

  • propertyName: string

Returns

boolean

public moveTo(newUrl: string, flags: MoveOperations)

Parameters

public publish(comment: string)

Parameters

  • comment: string

public recycle(): GuidResult

Moves the file to the recycle bin. MUST return the identifier of the new Recycle Bin item

Returns

GuidResult

public refreshLoad()

public retrieve()

public retrieve(propertyNames: Array<string>)

Parameters

  • propertyNames: Array<string>

public saveBinary(parameters: FileSaveBinaryInformation)

Parameters

public set_objectVersion(value: string)

Parameters

  • value: string

public unPublish(comment: string)

Removes the file from content approval with the specified comment.

Parameters

  • comment: string

public undoCheckOut()

Reverts an existing online or offline checkout for the file.