SharePoint 2010 File Name, Length, Size and Invalid Character Restrictions and Recommendations

While some things haven’t changed much, I felt it was important to revisit these classic file and folder restrictions. Today I was looking at my blog post from 2008 on file names, lengths, size and so on and noticed it was the most popular post on my old blog. I haven’t revisited that topic in a long time. I’ve updated it here, and added some additional recommendations.

Site, Folder and File name restrictions

KB Article 905231 I’ve added some additional symbols and recommendations.

  • Site Names
    • Not Allowed: | # { } % & <TAB>" ~ + / : * ? " < >
    • Avoid starting sites with an underscore (_) or with the period character.
    • Site names can cause confusion and corruption if they have periods, apostrophes or commas
    • They should not have consecutive periods or end with a period.
      • You cannot use the period character at the end of a site name
    • Many other symbols are not recommended such as $^()-_=+[]`! (other international currency symbols and international symbols should be avoided in site names, but some are more acceptable in file names. Ascii is preferred when possible.
  • Folder Names and File Names
    • Do not use: " # % & * : < > ? / { | } ~
    • File names cannot be longer than 128 characters
    • Do not use the period character consecutively in the middle of a file name.  For example, "file..name.docx" is invalid.
    • You cannot use the period character at the end of a file name
    • You cannot start a file name with the period character
    • Many other symbols are not recommended such as $^()-_=+[]`! (other international currency symbols and international symbols should be avoided in site names, but some are more acceptable in file names. Ascii is preferred when possible.
  • In addition, file names and folder names may not end with: (Many of these are international symbols)
    • .files, _files , -Dateien , _fichiers , _bestanden , _file ,_archivos ,-filer,_tiedostot ,_pliki ,_soubory ,_elemei ,

                   _arquivos ,_dosyalar ,_datoteke ,_fitxers,_failid 

                  ,_fails ,_bylos ,_fajlovi,_fitxategiak

Examples of Legal File Names

  • AllItems.docx
  • Dept_1234.doc
  • Long.Name.With.Dots.txt

Examples of Illegal Site Names

  • Intranet/sites/People & Process
  • Intranet/sites/My Math is 10% Here
  • Intranet/sites/_foobar
  • Intranet/sites/#FAIL
  • Intranet/sites/Jimmy+Bean

 

Examples of illegal file names:

  • HailCæsar.wav.
  • Wow…BadStuff.txt
  • 揵.htm
  • Roger&Hamerstein.mp3
  • WhatsUp?.doc

Note that word may let you save this, but uploading it to SharePoint will be your challenge. Sometimes you’re even allowed to upload it through the explorer view, and it will block you from the web interface.

 

File and Folder name lengths

  • 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. 

 

When using multi file upload interface: Make sure the total size of all your files is not greater than the upload limit set for your web application. 

 

File Size Maximums

Max File Size Default: 50MB Maximum setting: 2GB (per file)

List data: Max of 8kb of data

100 MB is what I recommend for most typical environments as a great compromise, but don’t recommend more than 500MB for most environments without External or Remote Blob storage.

(If you set it to 0 or 2047 MB, it will be the same as 2GB file.) Realistically a few hundred MB is really all you can get, unless you have fast LAN access. Even with LAN access there are cases where upload can fail… Out of memory errors in SQL, Out of memory on web front end, and various places where timeouts may occur. Server admins see the appendix.

NOTE: I understand that even if you use RBS or Remote Blob Storage and most third parties, you still can’t support files over 2GB, but you’ll have to check with your vendor.

 

Note:

I have heard of people who have had the issue of URLScan applied to the web server. It has a default limit of 30mb set in its .ini file. Once that file size is hit it was just dropping the transfer

 

 

As well there are other things that you can find that will block your files:

Each Web Application contains a list of blocked file types that is based on file name extensions. For example, you can block files that have the .exe extension. By default, many file types are blocked, including file types that are treated as executable by Internet Explorer. Files, whose names include braces, (for example, filename.{doc}) are also blocked by default.

 

Blocked File Type Reference (The Outlook 2010 blocked file resource file list is a great reference, and for understanding the files is actually even better than the default SharePoint Blocked File List)

Here are a few file types I typically remove from the blocked file list below: URL, LNK, CHM, HLP

I often add .MP3, PST, OST, and sometimes MP4. Some will add .ZIP, but I recommend allowing the .zip, arj, rar, etc… file as a common mechanism for transporting larger files.

 

File extension

File type

.ade

Microsoft Access project extension

.adp

Microsoft Access project

.app

Application file

.asp

Active server page

.bas

Microsoft Visual Basic class module

.bat

Batch file

.cer

Internet Security Certificate file

.chm

Compiled HTML Help file

.cmd

DOS command file, Microsoft Windows NT command script

.cnt

Windows Help contents file

.com

Microsoft MS_DOS program

.cpl

Control Panel extension

.crt

Security certificate

.csh

Script file

.der

DER Encoded X509 certificate file

.exe

Executable file

.fxp

Microsoft Visual FoxPro compiled program

.gadget

Windows Gadget

.grp

Windows program group file

.hlp

Help file

.hpj

Help project file

.hta

HTML program

.inf

Information or setup file

.ins

Internet Naming Service

.isp

Internet Communication settings

.its

Internet Document Set file

.jar

JAVA archive file

.js

JavaScript source code

.jse

JScript Encoded script file

.ksh

UNIX Shell script file

.lnk

Windows shortcut

.mad

Microsoft Access module shortcut

.maf

Microsoft Access shortcut

.mag

Microsoft Access diagram shortcut

.mam

Microsoft Access macro shortcut

.maq

Microsoft Access query shortcut

.mar

Microsoft Access report shortcut

.mas

Microsoft Access stored procedures

.mat

Microsoft Access table shortcut

.mau

Media attachment unit

.mav

Microsoft Access view shortcut

.maw

Microsoft Access data access page

.mcf

Manifest configuration file

.mda

Microsoft Access add-in program

.mdb

Microsoft Access program

.mde

Microsoft Access MDE database file

.mdt

Microsoft Access data file

.mdw

Microsoft Access workgroup

.mdz

Microsoft Access wizard program

.msc

Microsoft Common Console document

.msh

Windows PowerShell script helper

.msh1

Windows PowerShell script helper

.msh2

Windows PowerShell script helper

.mshxml

Windows PowerShell script helper

.msh1xml

Windows PowerShell script helper

.msh2xml

Windows PowerShell script helper

.msi

Windows Installer package

.msp

Windows Installer update package file

.mst

Visual Test source file

.ops

Microsoft Office profile settings file

.osd

Open software description file

.pcd

Microsoft Visual Test compiled script

.pif

Windows program information file

.pl

Perl script file

.plg

Developer Studio build log

.prf

Outlook profile file

.prg

Program source file

.ps1

Windows PowerShell

.ps1xml

Windows PowerShell

.ps2

Windows PowerShell

.ps2xml

Windows PowerShell

.psc1

Windows PowerShell

.psc2

Windows PowerShell

.pst

Microsoft Outlook personal folder file

.reg

Registration entries, Registry data file

.scf

Windows Explorer command file

.scr

Windows screen saver

.sct

Windows script component

.shb

Windows shortcut to a document

.shs

Shell Scrap object file

.tmp

Temporary file or folder

.url

Uniform Resource Locator (Internet shortcut)

.vb

Microsoft Visual Basic Scripting Edition (VBScript) file

.vbe

VBScript Encoded script file

.vbp

Visual Basic project file

.vbs

VBScript script file, Visual Basic for Applications script file

.vsmacros

Microsoft Visual Studio .NET binary-based macro project file

.vsw

Microsoft Visio workspace file

.ws

Windows script file

.wsc

Windows script component

.wsf

Windows script file

.wsh

Windows Script Host settings file

.xbap

XAML browser application

.xnk

Microsoft Exchange public folder shortcut

Appendix:

To set the upload size to 200 megabytes, use the following syntax:

stsadm -o setproperty -pn max-file-post-size -pv 200

To view the current setting of the maximum file post size property, use the following syntax:

stsadm -o getproperty -pn max-file-post-size –url http://server_name

 

For Admins you’ll need to make sure you increase your timeouts and settings:

IIS Connection Timeouts

  • 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.

  1.  
    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.

 

For Admins you can modify:

  • Central Admin – Security – Define blocked file typesWeb Application menu, click Change Web Application. Add blocked file extensions you want to block or remove those you want to remove.

 There are some settings for increasing your maximum timeout values including

Web.Config

ExecutionTimeout value to web config in the layouts folder and the virtualDirectoryFolder:

 

layouts dir

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>

   

virtualDirectoryFolder dir

Existing line

<httpRuntime maxRequestLength="51200" />

Replacement line

<httpRuntime executionTimeout="999999" maxRequestLength="51200" />

   

   

Default chunk size for large files:

Sharepoint default chunk size is set to 5MB, this means that if a client tries to open a document of 50MB and the chunk size is 5MB, the document is divided and retrieved in 10 chunks. Each chunk will be loaded into the memory of both the WFE handling the request and the SQL Server. Note I looked for a powershell setting and couldn’t find a reference in the 10 minutes I looked for you J By the way… don’t use smiley’s in your file names either J

   

stsadm -o setproperty -pn large-file-chunk-size -pv 1073741824

(Note: Requires IISReset) 

   

   

 

 

 


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s