Thursday, June 3, 2010

File Name, Length, Size and Invalid Character Restrictions and Large Size Recommendations

Starting simply with lengths:

• File and folder name lengths cannot be longer than 128 Characters in both WSS 2.0 and WSS 3.0.

• Link list items are restricted to 256 characters and will truncate links to SharePoint documents (or anything else) with lengths longer than this.

• When storing files the structure and files (entire path including sites, folders, and file name) cannot add up to more than 260 characters or they will see an error message or form validation error with the explanation around the URL length.

New Blocked File Types:

If you were familiar with the WSS 2.0 list, there are some new Blocked File Types: .asmx, .rem, .resx, .soap, or .ashx. If they existed before upgrade they are no longer visible or cannot be opened after upgrade. These file extensions have been added to the list of blocked file extensions.

You now have the ability to make differences between farm wide blocked file types and web application blocked file types. If you want to un block it, it needs to be removed at both farm and application levels, but you can add specific blocked files for a single web application. The farm level block list for example will override anything removed at the web application level.

Site Names:

• In WSS Site Names may not contain the following characters: \ / : * ? " < > # { } % & " ~ +

• You cannot start a site name, subsite name, or a site group name with an underscore (_) character or with the period character (I recommend avoiding the (_) underscore in site names)

• You cannot use the period character consecutively in the middle of a site name

• You cannot use the period character at the end of a site name

File Names:

• Invalid characters: " # % & * : < > ? \ / { } ~ 

• Cannot be longer than 128 characters

• You cannot use the period character consecutively in the middle of a file name

• You cannot use the period character at the end of a file name

• You cannot start a file name with the period character

Folder Names:

• You cannot use the following characters anywhere in a folder name or a server name: ~ # % & * { } \ : < > ? / "

• Cannot be longer than 128 characters

• You cannot use the period character consecutively in the middle of a folder name

• You cannot use the period character at the end of a folder name

• You cannot start a folder name with the period character

Max File Upload/Download Sizes:

The default max single file upload size is 50 MB by default for a web application. Microsoft IT limits their environment at 100 MB, and the maximum that the product itself can handle or support is 2GB which is essentially a SQL limit. By setting the limit to blank will essentially support what SQL will support. It's true that simply removing this, it doesn't mean that a user can upload a 2GB file. The server time out settings, browser and network speed play a large part in what is truly supportable. The 50MB is the best experience, but it's not uncommon for a large Excel file to be 60MB for example. I recommend using 50MB - 100MB for the best user experience, but for departmental solutions working with large AutoCAD files for example could support 200-500MB on a LAN.

Configuring Large File Support:

The biggest change included in Windows SharePoint Services SP1 is the support for uploading large files. By default, the maximum size for uploading files is set to 50 MB. If you need to be able to upload larger files (such as when you use smigrate.exe to migrate a site between servers), you can change this setting to any value up to 2 GB (2047 MB).

To configure large file support you must increase the default upload size in SharePoint Central Administration. You may also need to perform the following additional actions (depending on your hardware configuration):

• Tune the Microsoft Internet Information Services (IIS) connection timeout setting.

The default timeout for connections in IIS is 120 seconds (2 minutes). Depending on your maximum file size and how long it takes for the file to be uploaded, you may not need to change this setting. If, however, IIS is timing out when you upload large files, you can change this property to ensure that larger files can be uploaded successfully.

• Increase the default chunk size for large files.

The large-file-chunk-size property sets the amount of data that can be read from server running SQL Server at one time. If you have a file that is greater than your chunk size (such as 70 MB when the chunk size is set to 5 MB), the file would be read in 14 chunks (70 / 5). The chunk size is not related to the maximum upload file size. The chunk size simply specifies the amount of data that can be read from a file at one time. By default, the large-file-chunk-size property is set to 5 MB. If you notice performance or scale problems on the client or server, then you may need to tune this setting to get the performance you are targeting. Note that if you raise the chunk size too high, the files might use up too much front-end memory and you may need to lower this setting.

• Increase the maximum size limit for Web Parts.

By default, the maximum size limit for a Web Part is 1 MB. If you need to accommodate large Web Parts, you can change this setting in the web.config file for your server or servers running Windows SharePoint Services.

Increase the maximum upload size:

1. Get into the SharePoint Central Administration Site

2. Select "Application Management"

3. Under the "SharePoint Web Application Management" section select "Web Application General Settings"

4. Change the "Maximum Upload Size"

If IIS is timing out when you upload large files, you can configure the Connection timeout setting in IIS to allow more than the default 120 seconds (2 minutes).

Tune the IIS connection timeout:

1. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

2. Right-click the virtual server you want to configure, and then click Properties.

3. Click the Web Site tab.

4. In the Connections section, in the Connection timeout box, type the number of seconds you want IIS to wait before timing out.

5. Click OK.

Increase the default chunk size for large files:

The large–file–chunk–size property must be set from the command line. This property is configured for a server or server farm, and cannot be configured for an individual virtual server. To set this property, use the following syntax:

stsadm.exe -o setproperty -propertyname large-file-chunk-size -propertyvalue 1073741824

After making a change to this property, you must restart IIS. You can restart IIS by typing iisreset on the command line.

Increase the maximum limit for Web Parts:

This change is required only when working with large Web Parts. The maximum limit for Web Parts is set to 1048576 bytes by default.

1. On your server computer running Windows SharePoint Services, open Notepad.

2. In Notepad, navigate to the %HomeDrive%\Inetpub\wwwroot folder and open the web.config file.

3. Locate the PropertySize attribute in the configuration\SharePoint\WebPartLimits element.

4. Change the PropertySize attribute to the maximum size you need.

5. Save and close the web.config file.

Add the executionTimeout value:

1. Use Notepad to open the Web.config file.

By default, this file is in the following location: Program Files\Common Files\Microsoft Shared\Web server extensions\12\TEMPLATE\LAYOUTS

2. Add the executionTimeout value that you want. For example, replace the value as follows:

Existing code:

{location path="upload.aspx"}
 {system.web}
  {httpRuntime maxRequestLength="2097151" /}
 {/system.web}
{/location}

Replacement code:

{location path="upload.aspx"}
 {system.web}
  {httpRuntime executionTimeout="999999" maxRequestLength="2097151" /}
 {/system.web}
{/location}

3. After you change the file, click Save on the File menu.

4. Use Notepad to open the Web application Web.config file. By default, this file is in the following folder: Inetpub\wwwroot\wss\VirtualDirectories\VirtualDirectoryFolder

5. Change the following line in the file.

Existing line:

{httpRuntime maxRequestLength="51200" /}

Replacement line:

{httpRuntime executionTimeout="999999" maxRequestLength="51200" /}

6. After you change the file, click Save on the File menu.

7. Exit Notepad.

No comments: