Creating Virtual FTP Directories

Windows CE .NET enables you to create virtual FTP directories. Virtual directories appear to users who access your FTP site as a subdirectory of the FTP site's home directory, although they may be located in a different folder.

For example, if the FTP directory on your Windows CE-based device is set to the \Hard Disk\Ftproot directory, and your music files are stored under the \Hard Disk\Music folder, you can add the Music folder as a virtual root to the Ftproot directory. You create a virtual directory for the Music folder by associating the FTP virtual directory \Music with the real \Hard Disk\Music directory.

When users log onto the FTP server, they will see the Music folder in the FTP root directory and will be able to navigate to this folder as if it were actually located in the \Hard Disk\Ftproot\Music directory instead of in the \Hard Disk\Music directory.

You can only create virtual FTP directories at the root FTP directory. You cannot add nested or duplicate virtual roots, or separate virtual roots for folders that are children of another virtual root.

If you know the folder structure of your FTP server, you can create virtual directories by configuring the registry while you are building your target platform.

To create FTP virtual directories during the build process

  1. After you have created the configuration for your platform, in Platform Builder, under the Project Specific Files node, double-click the project.reg file.

  2. Add the following registry entry to the project.reg file:

    [HKEY_LOCAL_MACHINE\Comm\FTPD\VROOTS\<virtual_dir_name>]
    @="<real_path_name>"
    

    For example, to create a virtual directory for the Music folder, add the following syntax to project.reg:

    [HKEY_LOCAL_MACHINE\Comm\FTPD\VROOTS\\Hard Disk\Ftproot\Music]
    @="\Hard Disk\Music"
    
  3. From the Build menu choose Build Platform to build your platform.

You can also use the registry to grant or deny anonymous user access to virtual directories by setting the value for the AllowAnonymousVroots subkey in the [HKEY_LOCAL_MACHINE\Comm\FTPD] registry key.

To deny an anonymous user access to an FTP virtual root, set the value of the AllowAnonymousVroots subkey to zero (0). To grant a specific user access to FTP virtual roots, set the value of the AllowAnonymousVroots subkey to 1.

You can also use the Web-based network configuration utility to create virtual roots and assign user-specific rights. This sample configuration utility is located in the %_WINCEROOT%\Public\Servers\Sdk\Samples\Natadmin\FTP directory. For more information about this utility, see ICS Web-based Configuration Utility.

See Also

FTP Server | FTP Server Registry Settings

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.