Friday, September 18, 2009

Configure the FTP services

This step-by-step article describes how to install and configure a File Transfer Protocol (FTP) server for anonymous access

FTP depends on IIS (Internet Information Services), without IIS we cannnot configure FTP to the server.

1)Click Start, point to Control Panel, and then click Add or Remove Programs.
2)Click Add/Remove Windows Components.
3)In the Components list, click Application Server, click Internet Information Services (IIS) (but do not select or clear the check box), and then click Details.
4)Click to select the following check boxes (if they are not already selected):
Common FilesFile Transfer Protocol (FTP) ServiceInternet Information Services Manager
4)Click to select the check boxes next to any other IIS-related service or subcomponent that you want to install, and then click OK.
5)Click Next.
6)When you are prompted, insert the Windows Server 2003 CD-ROM into the computer's CD-ROM or DVD-ROM drive or provide a path to the location of the files, provide the path accordingly and then click OK.
7)Click Finish.
8)Open IIS (Internet Information Services) or else Go to run and type "inetmgr" to open IIS.
9)Expand Server_name, where Server_name is the name of the server.
10)Expand FTP Sites
11)Right-click Default FTP Site, and then click Properties.
12)Click the Security Accounts tab.
13)Click to select the Allow Anonymous Connections check box (if it is not already selected), and then click to select the Allow only anonymous connections check box. When you click to select the Allow only anonymous connections check box, you configure the FTP Service to allow only anonymous connections. Users cannot log on by using user names and passwords.
14)Click the Home Directory tab.
15)Click to select the Read and Log visits check boxes (if they are not already selected), and then click to clear the Write check box (if it is not already cleared).
16)Click OK.

Copy or move the files that you want to make available to the FTP publishing folder for access. The default folder is drive:\Inetpub\Ftproot, where drive is the drive on which IIS is installed.

Hopes this help you a lot....

Tuesday, September 8, 2009

SharePoint 2007 - Import from Spreadsheet to List

Import from Spreadsheet is the missing facet to the SharePoint 2007 List features. SharePoint let's a user create custom list from a spreadsheet, but lacks the ability to import data to an existing SP list. This feature developed in C# .Net and easy to install will do just that.

Here is the link http://spreadsheet2splist.codeplex.com

Friday, September 4, 2009

SharePoint web.config modification programmatically using c#

Here is the sample code to customize the web.config file for the SharePoint site programmatically
spSite = new SPSite(http://intranet.demo.com);
SPWeb spWeb = spSite.OpenWeb();
SPWebService service = SPWebService.ContentService;
SPWebApplication webApp = new SPSite("http://intranet.demo.com").WebApplication;
Configuration config = WebConfigurationManager.OpenWebConfiguration("/", spSite.WebApplication.Name);
XmlDocument doc = new XmlDocument();
doc.Load(configFilePath);
AppSettingsSection appSettings = config.AppSettings;
if (appSettings.ElementInformation.IsPresent)
{
XmlNode nodekey = doc.SelectSingleNode("configuration/appSettings/add[@key='key']");
if(nodekey == null)
{
SPWebConfigModification myModification = new SPWebConfigModification();
myModification.Path = "configuration/appSettings";
myModification.Name ="add[@key='userName']";
myModification.Sequence = 0;
myModification.Owner = "User Name";
myModification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
myModification.Value =
";
service.WebConfigModifications.Add(myModification);
}
}
/*Call Update and ApplyWebConfigModifications to save changes*/
service.Update();
service.ApplyWebConfigModifications();
As you can see, it is pretty simple and if you want to apply to the site spWeb.Site.WebApplication.WebConfigModifications.Add(MyModification)
If you want to apply to the whole farm
webApp.Farm.Services.GetValue().ApplyWebConfigModifications();
wenApp.Update();