FTP Site Start Method <Beginning>

Overview

The <Starting time> method of the <ftpServer> element starts the FTP site that <ftpServer> applies to. Once the <Start> method has been chosen, the run-time land for the FTP site can be determined by the value of the state attribute.

Compatibility

Version Notes
IIS 10.0 The <ftpServer> chemical element was not modified in IIS 10.0.
IIS eight.v The <ftpServer> element that includes the <Start> method was not modified in IIS 8.v.
IIS 8.0 The <ftpServer> element that includes the <Start> method was not modified in IIS viii.0.
IIS 7.v The <ftpServer> element that includes the <Start> method shipped as a feature of IIS 7.v.
IIS vii.0 The <ftpServer> element that includes the <First> method was introduced in FTP 7.0, which was a separate download for IIS seven.0.
IIS 6.0 Northward/A

Setup

To support FTP publishing for your Web server, you must install the FTP service. To practise and so, use the post-obit steps.

Windows Server 2012 or Windows Server 2012 R2

  1. On the taskbar, click Server Manager.

  2. In Server Director, click the Manage bill of fare, and and so click Add Roles and Features.

  3. In the Add Roles and Features wizard, click Next. Select the installation type and click Next. Select the destination server and click Adjacent.

  4. On the Server Roles page, expand Web Server (IIS), and then select FTP Server.

    Note

    To back up ASP.Membership authentication or IIS Manager hallmark for the FTP service, you will demand to select FTP Extensibility, in addition to FTP Service.
    Screenshot of the F T P Extensibility option being selected and highlighted. .

  5. Click Next, and and so on the Select features page, click Next again.

  6. On the Confirm installation selections page, click Install.

  7. On the Results page, click Shut.

Windows 8 or Windows 8.1

  1. On the Outset screen, move the arrow all the way to the lower left corner, right-click the Start push button, and so click Control Panel.

  2. In Command Panel, click Programs and Features, and so click Turn Windows features on or off.

  3. Expand Internet Data Services, and then select FTP Server.

    Note

    To support ASP.Membership authentication or IIS Manager authentication for the FTP service, y'all volition likewise need to select FTP Extensibility.
    Screenshot of the F T P Extensibility folder being selected and highlighted.

  4. Click OK.

  5. Click Close.

Windows Server 2008 R2

  1. On the taskbar, click Kickoff, point to Administrative Tools, and then click Server Director.

  2. In the Server Manager hierarchy pane, expand Roles, and then click Web Server (IIS).

  3. In the Web Server (IIS) pane, whorl to the Role Services section, and and then click Add Role Services.

  4. On the Select Role Services page of the Add Function Services Wizard, aggrandize FTP Server.

  5. Select FTP Service.

    Note

    To support ASP.Membership authentication or IIS Manager authentication for the FTP service, you will likewise need to select FTP Extensibility.
    Screenshot of the Select Role Services page showing the F T P Service option being highlighted and selected.

  6. Click Side by side.

  7. On the Confirm Installation Selections folio, click Install.

  8. On the Results page, click Close.

Windows vii

  1. On the taskbar, click Start, and so click Control Console.

  2. In Control Panel, click Programs and Features, and so click Turn Windows Features on or off.

  3. Expand Net Information Services, and and so FTP Server.

  4. Select FTP Service.

    Note

    To back up ASP.Membership hallmark or IIS Managing director hallmark for the FTP service, yous volition also need to select FTP Extensibility.
    Screenshot of the F T P Service folder and its sub folders.

  5. Click OK.

Windows Server 2008 or Windows Vista

  1. Download the installation package from the following URL:

    • https://world wide web.iis.cyberspace/expand/FTP
  2. Follow the instructions in the following walkthrough to install the FTP service:

    • Installing and Troubleshooting FTP 7

How To

How to starting time an FTP site

  1. Open Internet Information Services (IIS) Manager:

    • If y'all are using Windows Server 2012 or Windows Server 2012 R2:

      • On the taskbar, click Server Managing director, click Tools, and and so click Cyberspace Data Services (IIS) Manager.
    • If you are using Windows 8 or Windows viii.1:

      • Hold downwards the Windows key, printing the letter Ten, and then click Command Panel.
      • Click Administrative Tools, and so double-click Internet Information Services (IIS) Manager.
    • If you are using Windows Server 2008 or Windows Server 2008 R2:

      • On the taskbar, click Showtime, signal to Administrative Tools, and then click Net Information Services (IIS) Manager.
    • If you are using Windows Vista or Windows 7:

      • On the taskbar, click Beginning, and then click Control Panel.
      • Double-click Administrative Tools, and then double-click Internet Data Services (IIS) Manager.
  2. In the Connections pane, expand the server name, expand the Sites node, and and then click the name of the FTP site.

  3. In the Manage Website section of the Actions pane, click Start.

Configuration

The site-specific <ftpServer> element is configured at the site-level.

Attributes

Not applicative.

Child Elements

Not applicable.

Sample Lawmaking

The following examples enable you lot to start an FTP site programmatically.

C#

              using System; using System.Text; using Microsoft.Web.Administration;  internal static class Sample {     private static void Main()     {         using (ServerManager serverManager = new ServerManager())         {             Configuration config = serverManager.GetApplicationHostConfiguration();             // Recollect the sites collection.             ConfigurationSection sitesSection = config.GetSection("organisation.applicationHost/sites");             ConfigurationElementCollection sitesCollection = sitesSection.GetCollection();              // Locate a specific site.             ConfigurationElement siteElement = FindElement(sitesCollection, "site", "name", @"mySite");             if (siteElement == cypher) throw new InvalidOperationException("Chemical element not constitute!");              // Create an object for the ftpServer chemical element.             ConfigurationElement ftpServerElement = siteElement.GetChildElement("ftpServer");             // Create an example of the Outset method.             ConfigurationMethodInstance Get-go = ftpServerElement.Methods["Start"].CreateInstance();             // Execute the method to start the FTP site.             Offset.Execute();         }     }    private static ConfigurationElement FindElement(ConfigurationElementCollection collection, string elementTagName, params cord[] keyValues)    {       foreach (ConfigurationElement element in collection)       {          if (String.Equals(element.ElementTagName, elementTagName, StringComparison.OrdinalIgnoreCase))          {             bool matches = true;             for (int i = 0; i < keyValues.Length; i += ii)             {                object o = chemical element.GetAttributeValue(keyValues[i]);                string value = null;                if (o != null)                {                   value = o.ToString();                }                if (!String.Equals(value, keyValues[i + i], StringComparison.OrdinalIgnoreCase))                {                   matches = false;                   break;                }             }             if (matches)             {                return element;             }          }       }       return null;    } }                          

VB.Net

              Imports System Imports System.Text Imports Microsoft.Web.Administration  Module Sample     Sub Main()         Dim serverManager Equally ServerManager = New ServerManager         Dim config As Configuration = serverManager.GetApplicationHostConfiguration         ' Recollect the sites collection.         Dim sitesSection As ConfigurationSection = config.GetSection("system.applicationHost/sites")         Dim sitesCollection As ConfigurationElementCollection = sitesSection.GetCollection          ' Locate a specific site.         Dim siteElement As ConfigurationElement = FindElement(sitesCollection, "site", "proper noun", "mySite")         If (siteElement Is Nothing) And so             Throw New InvalidOperationException("Element not constitute!")         End If          ' Create an object for the ftpServer element.         Dim ftpServerElement As ConfigurationElement = siteElement.GetChildElement("ftpServer")         ' Create an instance of the FlushLog method.         Dim Showtime Every bit ConfigurationMethodInstance = ftpServerElement.Methods("Start").CreateInstance()         ' Execute the method to start the FTP site.         Beginning.Execute()      End Sub    Private Function FindElement(ByVal collection As ConfigurationElementCollection, ByVal elementTagName Equally String, ByVal ParamArray keyValues() As String) Every bit ConfigurationElement       For Each chemical element As ConfigurationElement In drove          If String.Equals(element.ElementTagName, elementTagName, StringComparison.OrdinalIgnoreCase) And then             Dim matches As Boolean = Truthful             Dim i As Integer             For i = 0 To keyValues.Length - 1 Step 2                Dim o As Object = chemical element.GetAttributeValue(keyValues(i))                Dim value As String = Cipher                If (Not (o) Is Nothing) So                   value = o.ToString                End If                If Non Cord.Equals(value, keyValues((i + 1)), StringComparison.OrdinalIgnoreCase) And so                   matches = False                   Exit For                End If             Next             If matches Then                Return element             Terminate If          Finish If       Adjacent       Return Goose egg    End Part  End Module                          

JavaScript

              // Create a Writable Admin Manager object. var adminManager = new ActiveXObject('Microsoft.ApplicationHost.WritableAdminManager'); adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST";  // Call up the sites collection. var sitesSection = adminManager.GetAdminSection("system.applicationHost/sites","Motorcar/WEBROOT/APPHOST"); var sitesCollection = sitesSection.Collection;  // Locate a specific site. var siteElementPos = FindElement(sitesCollection,"site",["name","MySite"]); if (siteElementPos == -ane) throw "Element non found!";  // Retrieve the site element. var siteElement = sitesCollection.Item(siteElementPos); // Create an object for the ftpServer element. var ftpServerElement = siteElement.ChildElements.Item("ftpServer"); // Create an instance of the first method. var Start = ftpServerElement.Methods.Detail("Start").CreateInstance(); // Execute the method to showtime the FTP site. First.Execute();  function FindElement(collection, elementTagName, valuesToMatch) {    for (var i = 0; i < collection.Count; i++) {       var chemical element = collection.Item(i);       if (element.Name == elementTagName) {          var matches = true;          for (var iVal = 0; iVal < valuesToMatch.length; iVal += two) {             var property = element.GetPropertyByName(valuesToMatch[iVal]);             var value = property.Value;             if (value != null) {                value = value.toString();             }             if (value != valuesToMatch[iVal + i]) {                matches = false;                pause;             }          }          if (matches) {             return i;          }       }    }    render -1; }                          

VBScript

              ' Create a Writable Admin Manager object. Set adminManager = CreateObject("Microsoft.ApplicationHost.WritableAdminManager") adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"  ' Retrieve the sites collection. Set sitesSection = adminManager.GetAdminSection("system.applicationHost/sites","MACHINE/WEBROOT/APPHOST") Ready sitesCollection = sitesSection.Collection  ' Locate a specific site. siteElementPos = FindElement(sitesCollection,"site",Assortment("name","MySite")) If siteElementPos = -1 Then    WScript.Echo "Element not constitute!"    WScript.Quit End If  ' Retrieve the site element. Prepare siteElement = sitesCollection.Item(siteElementPos) ' Create an object for the ftpServer element. Set ftpServerElement = siteElement.ChildElements.Detail("ftpServer") ' Create an instance of the First method. Set Start = ftpServerElement.Methods.Item("Commencement").CreateInstance() ' Execute the method to start the FTP site. Offset.Execute()  Function FindElement(collection, elementTagName, valuesToMatch)    For i = 0 To CInt(drove.Count) - 1       Fix element = collection.Item(i)       If element.Name = elementTagName Then          matches = True          For iVal = 0 To UBound(valuesToMatch) Footstep 2             Set holding = element.GetPropertyByName(valuesToMatch(iVal))             value = property.Value             If Not IsNull(value) Then                value = CStr(value)             Finish If             If Not value = CStr(valuesToMatch(iVal + i)) Then                matches = False                Get out For             Terminate If          Adjacent          If matches Then             Exit For          End If       Stop If    Next    If matches Then       FindElement = i    Else       FindElement = -1    End If Finish Function