共用方式為


File Element (Module)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Specifies a file to include within a module in a site definition.

<File
  IgnoreIfAlreadyExists = "TRUE" | "FALSE"
  Name = "Text"
  NavBarHome = "TRUE" | "FALSE"
  Path = "Text"
  Type = "Text"
  Url = "Text >
</File>

Attributes

Attribute

Description

IgnoreIfAlreadyExists

Optional Boolean. TRUE to provision the view even if the file aready exists at the specified URL; otherwise, FALSE.

Name

Optional Text. Specifies the virtual path for the file. Cannot contain the following characters:

  • \"

  • #

  • %

  • &

  • *

  • :

  • <

  • >

  • ?

  • \\

  • {

  • }

  • |

  • ~

  • \x7f

NavBarHome

Optional Boolean. TRUE if the file is the destination URL for the Home link in the top navigation bar used throughout the site.

Path

Optional Text. Specifies the physical path to the file relative to \\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Features\Feature. Can only contain the following characters:

  • alphanumeric

  • hyphen (-)

  • underscore (_)

  • period (.)

  • space ( )

Type

Optional Text. Specifies that the file be cached in memory on the front-end Web server. Possible values include Ghostable and GhostableInLibrary. Both values specify that the file be cached, but GhostableInLibrary specifies that the file be cached as part of a list whose base type is DocumentLibrary.

When changes are made, for example, to the home page through the UI, only the differences from the original page definition are stored in the database, while default.aspx is cached in memory along with the schema files. The HTML page that is displayed in the browser is constructed through the combined definition resulting from the original definition cached in memory and from changes stored in the database.

Url

Required Text. Specifies the virtual path for the file. If the Name attribute is specified, its value is used for the virtual path. If Path is not specified, the value of Url is used for the physical path. Cannot contain the following characters:

  • \"

  • #

  • %

  • &

  • *

  • :

  • <

  • >

  • ?

  • \\

  • {

  • }

  • |

  • ~

  • \x7f

Child Elements

AllUsersWebPart, NavBarPage, Property, View

Parent Elements

Module

Occurrences

Minimum: 0

Maximum: Unbounded

Example

For an example of how this element is used, see Modules.

Microsoft.Win32.RegistryKey#4

See Also

Concepts

Module

Modules

How to: Provision a File