Microsoft KB Archive/309634

= You receive the &quot;Cannot create a file when that file already exists&quot; error message when you try to rename a file in IIS =

Article ID: 309634

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Services 6.0
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q309634





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

 At a command prompt, change to the folder where you extracted the Mdutil.exe file from. Type the following command, where  is the instance number of the site that requires this property, and then press ENTER:

mdutil set msftpsvc/ /AllowReplaceOnRename 1

Note This setting only works at the site level. You cannot configure this setting at the service level. 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:  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

</li> Click Start, point to All Programs, point to IIS Resources, point to Metabase Explorer, and then click Metabase Explorer.</li> Expand LM, and then expand MSFTPSVC.</li> 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.</li> Type 5009 in the Record Name or Identifier box, and then click OK.</li> Right-click the property that you added in step 5, and then click Properties.</li> Set Value to 1, and then click the General tab.</li> Click to select the Inheritable check box, and then click OK.</li> Quit Metabase Explorer.</li></ol>

Additional query words: IIS 5 FTP Replace PUT Rename Allow

Keywords: kbtshoot kbprb KB309634

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.