SPFile Members
Include Protected Members
Include Inherited Members
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.
The SPFile type exposes the following members.
Properties
Name | Description | |
---|---|---|
Author | Gets an object that represents the user who uploaded the document to the server or created the document on the server. | |
BackwardLinks | Gets a collection of link objects that represent the backward links of the file. | |
CharSetName | Gets the name of the character set that is used in the file. | |
CheckedOutBy | Gets the user who has checked out the file. | |
CheckedOutDate | Gets the date and time that the file was checked out. | |
CheckInComment | Gets the comment that is used when a document is checked into a document library. | |
CheckOutExpires | Gets the date and time that the short-term check-out expires. | |
CheckOutStatus | Gets the status of the check-out, indicating whether the check-out is long-term or short-term. | |
CustomizedPageStatus | Gets the customization (also known as "ghost") status of the file object. | |
EventReceivers | Gets the collection of event receiver definitions for the file. | |
Exists | Gets a Boolean value that indicates whether the file exists. | |
ForwardLinks | Gets a collection of link objects that represent the forward links in the file. | |
GeneratingConverterId | Gets the ID of the transformer that is used to create the file, or Guid.Empty if the file is not a child file. | |
Generator | Gets the name of the application that created the .htm or .aspx file. | |
IconUrl | Gets the URL to the icon that is associated with the file. | |
InDocumentLibrary | Gets a Boolean value that indicates whether the file belongs to a document library. | |
IsConvertedFile | Gets a Boolean value that indicates whether the file object was created as part of a document transform. | |
IsIRMed | Gets a Boolean value that indicates whether Information Rights Management is enabled for the file. | |
Item | Gets the list item object that corresponds to the file if the file belongs to a document library. | |
Length | Gets the size of the file in bytes, excluding the size of any Web Parts that are used in the file. | |
LengthByUser | Gets a collection of user storage objects that contain information about each user of the Web Part Page, including the user name, user ID, and the number of bytes that the Web Part personalizations consume. | |
Level | Gets the level of publication for the file. | |
MajorVersion | Gets the major version of the file. | |
MinorVersion | Gets the minor version of the file. | |
ModifiedBy | Gets a user object that represents the user who last modified the file. | |
Name | Gets the name of the file including the extension. | |
ParentFolder | Gets the parent folder of the file. | |
ProgID | Gets a string that identifies the application in which the file was created. | |
Properties | Gets metadata for the file. | |
ServerRedirected | Gets a Boolean value that indicates whether users who do not have access to view the source file, or who do not have the appropriate client application installed, are redirected to server-side rendering of the file when they click a link to view it. | |
ServerRelativeUrl | Gets the relative URL of the file based on the URL for the server. | |
SourceFile | Gets the parent file object of the file that was created through document transforms. | |
SourceLeafName | Gets the leaf name of the parent document for the file. | |
SourceUIVersion | Gets the version number of the parent document for the file. | |
TimeCreated | Gets a date and time value that indicates when the file was created. | |
TimeLastModified | Gets a date and time value that indicates when the file was last modified. | |
Title | Gets the display name of the file. | |
TotalLength | Gets the size of the file in bytes, including the size of any Web Parts that are used in the file. | |
UIVersion | Gets the version number of the file. | |
UIVersionLabel | Gets the version of the file. | |
UniqueId | Gets the GUID that uniquely identifies the file in the content database. | |
Url | Gets the site-relative URL of the file. | |
Versions | Gets a collection of file version objects that represent the versions of the file. |
Top
Methods
Name | Description | |
---|---|---|
Approve | Approves the file submitted for content approval with the specified comment. | |
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 based on a Boolean value that indicates whether to check the file out to the local computer, and that indicates the last date that the file was modified. | |
Convert | Transforms the file using the specified transformer. | |
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 but overwrites an existing file of the same name only if bOverwrite is true. | |
Delete | Deletes the file object. | |
DeleteAllPersonalizations | Deletes all personalization information from the Web Part Page, home page, or wiki page for the user with the specified ID. | |
DeleteAllPersonalizationsAllUsers | Deletes personalization information for all users from the Web Part Page. | |
Deny | Rejects a file that was submitted for content approval. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetConversionState | Returns the transform state of the file with respect to the specified transformer ID. | |
GetConvertedFile | 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 Part Page. | |
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 Part Page.) | |
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 but overwrites an existing file of the same name only if bOverwrite is true. | |
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. | |
Publish | Submits the file for content approval with the specified comment. | |
Recycle | Sends the file to the recycle bin. | |
ReplaceLink | Replaces all instances in the file of a specified link with a new link. | |
RevertContentStream | Returns the file to its original uncustomized state so that its logic becomes cached in memory (also known as "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, Boolean) | Saves the file in binary format based on the specified stream and a Boolean value that specifies whether to check required fields. | |
ScheduleEnd | Sets the date on which a file will be removed from public views of a document library. | |
ScheduleStart(DateTime) | Schedules automatic approval of a document in a moderated library. | |
ScheduleStart(DateTime, Boolean) | Schedules automatic approval of a document in a moderated library and, optionally, leaves the moderation status of the item unchanged. | |
ScheduleStart(DateTime, String) | Schedules automatic approval of a document in a moderated library and specifies text for the approval comment. | |
ScheduleStart(DateTime, Boolean, String) | Schedules automatic approval of a document in a moderated library, specifies the text of the approval comment, and optionally changes the list item’s moderation status. | |
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. | |
SetHtmlTranslateCacheItem | Puts the contents of the file into the cache for HTML translation. | |
StorageManagementWebPartPageInformation | Returns information about storage management for the Web Part 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 check-out. | |
UnPublish | Removes the file with the specified comment from content approval. | |
Update | Updates the database with changes that are made to the file. |
Top