Type Default Value Description
string Dependent on uploaded file. Gets the name of the file on the client's machine in a Windows safe format.



This contains the name of the uploaded file translated into a format that can be used to save the file.

This property contains a file name rather than a file path. This means that it contains no directory information. Typical values might be "My File.htm", "My Picture.jpg" or "Bits&Pieces.txt".

In general you should only use the WinSafeFileName for saving the file when the original name is essential to the upload. In other cases you should assign a new name to your file to allow you to maintain control over the names of files saved on your server. If you require a unique name for every file you may wish to use the System.Guid static methods for generating Unique IDs.

Note that the fact that the file name is safe for saving does not mean that it is safe to use in a URL. For instance it may contain spaces or Unicode characters. If you need a URL safe name you should use the URLSafeFileName property.

If files containing illegal characters are uploaded from Macintosh browsers the names will be translated into the standard Services for Macintosh (SFM) Unicode format so that they can be saved intact. To a Windows user the file may appear to contain unusual characters but to a Macintosh user the name will appear as it was when uploaded.

In other cases when uploaded file names contain illegal characters these are deleted so that the file name can be used as part of a save name.


See Also

SaveSFM method. FileName property. URLSafeFileName property.