SPFile methods
The SPFile type exposes the following members.
Methods
Name | Description | |
---|---|---|
AddProperty | Adds an item to the list of metadata for the file. | |
Approve | Approves the file submitted for content approval with the specified comment. | |
CanOpenFile(Boolean) | Indicates whether the current user has permission to view the content of the file, specifying a level of access. | |
CanOpenFile(Boolean, String) | Indicates whether the current user has permission to view the content of the file, specifying a level of access and an output variable to receive an ETag. | |
CheckIn(String) | Checks in the file to a document library with the specified comment. | |
CheckIn(String, SPCheckinType) | Checks in the file to a document library based on the specified comment and type of check in to perform. | |
CheckOut() | Checks the file out of a document library. | |
CheckOut(Boolean, String) | Checks out the file from a document library by specifying whether to check out the file to the local computer and by specifying that the file should not be checked out if it has been modified after a particular date. | |
CheckOut(SPFile.SPCheckOutType, String) | Checks out the file from a document library by specifying the type of checkout and by specifying that the file should not be checked out if it has been modified after a particular date. | |
Convert | Obsolete. Transforms the file using the specified transformer. | |
ConvertLock | Converts an existing lock on the file to a new type of lock. | |
CopyTo(String) | Copies the file to the destination URL but does not overwrite an existing file of the same name. | |
CopyTo(String, Boolean) | Copies the file to the destination URL and optionally overwrites an existing file of the same name. | |
CreateSharedAccessRequest | Requests shared access for the file. | |
Delete | Deletes the file object. | |
DeleteAllPersonalizations | Deletes all personalization information from theWeb Parts page, home page, or wiki page for the user with the specified ID. | |
DeleteAllPersonalizationsAllUsers | Deletes personalization information for all users from the Web Parts page. | |
DeleteCellStoragePartition | Deletes all entries in the specified cell storage partition. | |
DeleteProperty | Deletes an item from the list of metadata for the file. | |
Deny | Denies approval for a file that was submitted for content approval. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetConversionState | Obsolete. Returns the transform state of the file to the specified transformer ID. | |
GetConvertedFile | Obsolete. Returns the child file that was created from this file using document transforms and the specified transformer. | |
GetHashCode | (Inherited from Object.) | |
GetHtmlTranslateCacheItem | Returns the contents of the file from the cache for HTML translation, excluding cache items that are older than the date the file was last modified. | |
GetHtmlTranslateCacheNameFromStsName | Returns the name of the main file from the cache for HTML translation. | |
GetLimitedWebPartManager | Returns the Web Part manager that is associated with the Web Parts page. | |
GetListItem | Gets the SPListItem that corresponds to this file, if this file belongs to a document library. Also gets values for specified fields. | |
GetProperty | Gets the value from an item in the list of metadata for the file based on the specified key. | |
GetType | (Inherited from Object.) | |
GetWebPartCollection | Obsolete. Use the GetLimitedWebPartManager method to return an SPLimitedWebPartManager object to manage Web Parts instead. (In Windows SharePoint Services 2.0 the GetWebPartCollection method returned the Web Part collection that is associated with the Web Parts page.) | |
Lock | Creates a lock on the file, preventing other users from modifying it. | |
MemberwiseClone | (Inherited from Object.) | |
MoveTo(String) | Moves the file to the destination URL but does not overwrite an existing file of the same name. | |
MoveTo(String, SPMoveOperations) | Moves the file to the specified destination URL based on the type of operation that is specified. | |
MoveTo(String, Boolean) | Moves the file to the destination URL and optionally overwrites an existing file of the same name. | |
MoveTo(String, SPMoveOperations, Boolean) | Moves the file to the specified destination URL. | |
OpenBinary() | Opens the file in binary format. | |
OpenBinary(SPOpenBinaryOptions) | Opens the specified file as a byte array and specifies options that control how the file opens. | |
OpenBinaryStream() | Opens the file as a stream. | |
OpenBinaryStream(SPOpenBinaryOptions) | Opens the specified file as a stream and specifies options that control how the file opens. | |
OpenBinaryStream(SPOpenBinaryOptions, String, String) | Opens the file as a stream based on the specified options. | |
OpenBinaryStream(SPOpenBinaryOptions, String, SPFileRightsManagementSettings, String, String) | ||
OpenFileFormatMetaInfoStream | ||
Publish | Submits the file for content approval with the specified comment. | |
Recycle | Sends the file to the recycle bin. | |
RefreshLock | Renews an existing lock on the file. | |
ReleaseLock | Releases an existing lock that is specified by its identifier (ID). | |
RemoveSharedAccessRequest | ||
ReplaceLink | Replaces all instances in the file of a specified link with a new link. | |
RevertContentStream | Returns the file to its original state so that its logic becomes cached in memory (or "ghosted") rather than stored in the database. | |
SaveBinary([]) | Saves the file in binary format based on the specified byte array. | |
SaveBinary(Stream) | Saves the file in binary format based on the specified stream. | |
SaveBinary([], Boolean) | Saves the file in binary format based on the specified byte array and a Boolean value that specifies whether to check required fields. | |
SaveBinary(Stream, SPFileSaveBinaryParameters) | Saves the file in binary format based on a stream that contains a file and an SPFileSaveBinaryParameters object with additional parameters. | |
SaveBinary(Stream, Boolean) | Saves the file in binary format based on the specified stream and a Boolean value that specifies whether to check required fields. | |
SaveBinary(Stream, Boolean, Boolean, String, String, Stream, String) | Saves the file and file format metadata based on the specified streams, strings, and optional ETag value. | |
SaveBinary(Stream, Boolean, Boolean, String, String, Stream, Boolean, String) | Saves the file and file format metadata based on the specified streams, strings, Boolean value, and optional ETag value. | |
SaveFileFormatMetaInfoStream | Saves the stream of metadata that contains file format information for the specified file to the database. | |
ScheduleEnd | Sets the date on which a file will be removed from public views of a document library. | |
ScheduleStart(DateTime) | Schedules the automatic approval of a document in a moderated library at the specified date and time. | |
ScheduleStart(DateTime, Boolean) | Schedules the automatic approval of a document in a moderated library at the specified date and time, and optionally leaves the moderation status of the item unchanged. | |
ScheduleStart(DateTime, String) | Schedules automatic approval of a document in a moderated library at the specified date and time with the specified explanation for the approval. | |
ScheduleStart(DateTime, Boolean, String) | Schedules the automatic approval of a document in a moderated library at the specified date and time, with the specified approval comment, and optionally changes the moderation status of the list item. | |
SendToOfficialFile(String) | Sends the file to a records repository. | |
SendToOfficialFile(String, String) | Sends the file to a records repository and specifies the name of a record routing type. | |
SendToOfficialFile(String, SPOfficialFileHost, String, SPOfficialFileSubmissionMode, String) | Sends file to a specific URL. | |
SendToOfficialFile(String, SPOfficialFileHost, [], String, SPOfficialFileSubmissionMode, String) | Sends file to a specific URL. | |
SendToOfficialFile(SPWeb, Uri, [], [], String, Uri, String, SPOfficialFileSubmissionMode, SPFile.CustomFileSubmissionPostProcessing, String) | Sends file to a destination router. | |
SetHtmlTranslateCacheItem | Saves the contents of the file into a cache for HTML translation. | |
SetProperty | Sets the value of an item in the list of metadata for the file. | |
StorageManagementWebPartPageInformation | Obsolete. Returns information about storage management for the Web Parts page. | |
TakeOffline | Takes the most current approved or major version of the file offline. | |
ToString | Returns the URL for the file based on the site or subsite URL. (Overrides Object.ToString().) | |
UndoCheckOut | Undoes the file checkout. | |
UnPublish | Removes the file with the specified comment from content approval. | |
Update | Updates the database with changes that are made to the file. |
Top