File methods
The File type exposes the following members.
Methods
Name | Description | |
---|---|---|
Approve | Approves the file submitted for content approval with the specified comment. | |
CancelUpload | Stops the chunk upload session without saving the uploaded data. If the file doesn’t already exist in the library, the partially updated file will be deleted. Use this in response to user action (as in a request to cancel an upload) or an error or exception. | |
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. | |
CheckUninitializedProperty | Checks to determine whether the specified value type property of a ClientObject has been initialized. (Inherited from ClientObject.) | |
ContinueUpload | Continues the chunk upload session with an additional fragment. The current file content is not changed. | |
CopyTo | Copies the file to the destination URL. Server must overwrite an existing file of the same name if bOverwrite is true. | |
CopyToUsingPath | ||
CustomFromJson | Returns a Boolean value that indicates whether custom code was used to populate an object. This member is reserved for internal use and is not intended to be used directly from your code. (Inherited from ClientObject.) | |
DeleteObject | Deletes the file object. | |
Deny | Denies approval for a file that was submitted for content approval. | |
ExecuteCobaltRequest | ||
FinishUpload | Uploads the last file fragment and commits the file. The current file content is changed when this method completes. | |
FromJson | Indicates whether custom code was used to populate an object. This member is reserved for internal use and is not intended to be used directly from your code. (Inherited from ClientObject.) | |
GetContentVerFromTag | Reserved for internal use only. This method exposes the internal ContentVersion value inside of a ContentTag. | |
GetImagePreviewUri | ||
GetImagePreviewUrl | ||
GetLimitedWebPartManager | Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view. | |
GetPreAuthorizedAccessUrl | ||
GetUploadStatus | ||
GetWOPIFrameUrl | ||
InitNonPropertyFieldFromJson | Initializes a non-property field of the client object based on JavaScript Object Notation (JSON) data from the server. This member is reserved for internal use and is not intended to be used directly from your code. (Inherited from ClientObject.) | |
InitOnePropertyFromJson | (Overrides ClientObject.InitOnePropertyFromJson(String, JsonReader).) | |
IsObjectPropertyInstantiated | Indicates whether the specified property of the client object is instantiated. (Inherited from ClientObject.) | |
IsPropertyAvailable | Returns a Boolean value that indicates whether the specified scalar property has been retrieved or set. (Inherited from ClientObject.) | |
LoadExpandoFields | Initializes the extended properties associated with the client object when overridden in a derived class. (Inherited from ClientObject.) | |
MoveTo | Moves the file to the specified destination URL. | |
MoveToUsingPath | ||
OpenBinaryDirect | Downloads the specified file from a SharePoint site without requiring an ExecuteQuery() method call. | |
OpenBinaryStream | Opens the file as a stream. | |
Publish | Submits the file for content approval with the specified comment. | |
Recycle | Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item. | |
RecycleWithETag | ||
RefreshLoad | Reloads all scalar properties associated with the client object when overridden in a derived class. (Inherited from ClientObject.) | |
RemoveFromParentCollection | Removes the current client object from the parent client object collection. (Inherited from ClientObject.) | |
Retrieve() | Retrieves all scalar properties associated with the object. This member is reserved for internal use and is not intended to be used directly from your code. (Inherited from ClientObject.) | |
Retrieve([]) | Retrieves the specified scalar properties associated with the object. This member is reserved for internal use and is not intended to be used directly from your code. (Inherited from ClientObject.) | |
SaveBinary | Saves the specified file into a document library. | |
SaveBinaryDirect(ClientContext, String, Stream, Boolean) | Uploads the specified file to a SharePoint site without requiring an ExecuteQuery() method call. | |
SaveBinaryDirect(ClientContext, String, Stream, String) | Uploads the specified file to a SharePoint site with the specified Etag without requiring an ExecuteQuery() method call. | |
StartUpload | Starts a new chunk upload session and uploads the first fragment. The current file content is not changed when this method completes. The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.The upload session ends either when you use the CancelUpload(Guid) method or when you successfully complete the upload session by passing the rest of the file contents through the ContinueUpload(Guid, Int64, Stream) and FinishUpload(Guid, Int64, Stream) methods.For example, you can pass a 35 MB file by dividing it into three 10 MB streams and one 5 MB stream and uploading them this way (using the resulting offset values of 10, 20 and 30 MB):StartUpload(GUID, stream1) ContinueUpload(GUID, 10 MB, stream2) ContinueUpload(GUID, 20 MB, stream3) FinishUpload(GUID, 30 MB, stream4)The StartUpload(Guid, Stream) and ContinueUpload(Guid, Int64, Stream) methods return the size of the running total of uploaded data in bytes, so you can pass those return values to subsequent uses of ContinueUpload(Guid, Int64, Stream) and FinishUpload(Guid, Int64, Stream) |
|
ToString | (Inherited from Object.) | |
UndoCheckOut | Reverts an existing checkout for the file. | |
UnPublish | Removes the file from content approval or unpublish a major version. | |
Update | ||
UpdateClientObjectPropertyType | Updates the client object property's value to have correct type by using the type information returned from the server. (Inherited from ClientObject.) |
Top