You receive the "Cannot create a file when that file already exists" error message when you try to rename a file in IIS

Article translations Article translations
Article ID: 309634 - View products that this article applies to.
This article was previously published under Q309634
Expand all | Collapse all

On This Page

SYMPTOMS

You use a File Transfer Protocol (FTP) client to connect to the server, and then you put a file on the server by using the FTP PUT command. If you rename the file by using a file name that already exists or by using a file name that previously existed and that still exists in the cache, the FTP client receives the following error message from the FTP Publishing Service in Microsoft Internet Information Services (IIS):
550 FileName: Cannot create a file when that file already exists.
Therefore, you cannot rename a file if another file with the same name already exists.

CAUSE

This issue occurs if the AllowReplaceOnRename metabase property is not set to 1.

RESOLUTION

To resolve this issue, use one of the following methods:

Method 1: Use the Mdutil.exe tool

Use the Mdutil.exe tool to modify the metabase and set the AllowReplaceOnRename property to 1. Use this method if you are running IIS 6.0 or if you are running IIS 5.0.

Note By default, the AllowReplaceOnRename property is set to 1 in Internet Information Server (IIS) 4.0. The steps in this article do not apply to IIS 4.0.

To use the Mdutil.exe tool to set the AllowReplaceOnRename property to 1, follow these steps:
  1. Obtain the Mdutil.exe tool.

    The Mdutil.exe tool is located in the I386 folder of the Microsoft Windows 2000 CD. You must use the Expand.exe command-line tool to extract the Mdutil.ex_ file from the i386 folder of the Windows 2000 CD. For additional information about the Mdutil.exe tool, click the following article number to view the article in the Microsoft Knowledge Base:
    240225 Description of Adsutil and MetaEdit utilities used to modify the metabase
    Note Because the property is unnamed in the IIS 5.0 metabase schema, you cannot use the Adsutil.vbs tool to set the AllowReplaceOnRename property. Use the Mdutil.exe tool to set the AllowReplaceOnRename metabase property.
  2. At a command prompt, change to the folder where you extracted the Mdutil.exe file from.
  3. Type the following command, where n is the instance number of the site that requires this property, and then press ENTER:

    mdutil set msftpsvc/n/AllowReplaceOnRename 1

    Note This setting only works at the site level. You cannot configure this setting at the service level.
  4. Restart the IIS Admin Service.

Method 2: Use Metabase Explorer

Use Metabase Explorer to modify the metabase if you are running IIS 6.0. To do this, follow these steps:
  1. Install Metabase Explorer if it is not already installed.

    The Metabase Explorer tool is included in the IIS 6.0 Resource Kit Tools. To obtain the IIS 6.0 Resource Kit Tools, visit the following Microsoft Web site:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499
  2. Click Start, point to All Programs, point to IIS Resources, point to Metabase Explorer, and then click Metabase Explorer.
  3. Expand LM, and then expand MSFTPSVC.
  4. Right-click the number that represents the FTP site, point to New, and then click DWORD Record.

    For example, right-click 1, point to New, and then click DWORD Record.
  5. Type 5009 in the Record Name or Identifier box, and then click OK.
  6. Right-click the property that you added in step 5, and then click Properties.
  7. Set Value to 1, and then click the General tab.
  8. Click to select the Inheritable check box, and then click OK.
  9. Quit Metabase Explorer.

Properties

Article ID: 309634 - Last Review: December 3, 2007 - Revision: 4.2
APPLIES TO
  • Microsoft Internet Information Services 6.0
  • Microsoft Internet Information Services 5.0
Keywords: 
kbtshoot kbprb KB309634

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com