Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


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.

↑ Back to the top


Cause

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

↑ Back to the top


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

↑ Back to the top


Keywords: kbiis2007swept, kbtshoot, kbprb, kb

↑ Back to the top

Article Info
Article ID : 309634
Revision : 6
Created on : 6/10/2019
Published on : 6/10/2019
Exists online : False
Views : 1009