Was hosting a WCF Service in IIS on my machine.
Realized that Windows Authentication option was missing.

To add it, go to
Control Panel à Program Features à Turn Windows Features On and Off
Enable Windows Authentication.


Hope it helps
Was hosting a WCF Service in IIS on my machine.
Realized that Windows Authentication option was missing.

To add it, go to
Control Panel à Program Features à Turn Windows Features On and Off
Enable Windows Authentication.


Hope it helps
Nice tip !
So if you are one of few that are using IE11 and SharePoint 2013 you have probably noticed many corruptions and misbehaves in UI. So far I have discovered the following problems:
So until we get official CU or SP from SharePoint team, run your sites in compatibility mode.
public static void UploadDocument(
string siteURL,
string documentListName,
string documentListURL,
string documentName,
byte[] documentStream,
string folderName,
string invoiceId)
{
using (var clientContext = new ClientContext(siteURL))
{
// Get Document List
var documentsList = clientContext.Web.Lists.GetByTitle(documentListName);
// check if folder already exists else create folder
if (!FolderExists(clientContext.Web, documentListName, folderName))
{
var info = new ListItemCreationInformation();
info.UnderlyingObjectType = FileSystemObjectType.Folder;
info.LeafName = folderName.Trim();
var newItem = documentsList.AddItem(info);
newItem["Title"] = folderName;
newItem.Update();
clientContext.ExecuteQuery();
}
var fileCreationInformation = new FileCreationInformation();
// Assign to content byte[] i.e. documentStream
fileCreationInformation.Content = documentStream;
// Allow owerwrite of document
fileCreationInformation.Overwrite = true;
// Upload URL
fileCreationInformation.Url = siteURL + documentListURL + folderName + "/" + documentName;
var uploadFile = documentsList.RootFolder.Files.Add(fileCreationInformation);
// Update the metadata for a field having name "DocType"
uploadFile.ListItemAllFields["Invoice_x0020_Id"] = invoiceId;
uploadFile.ListItemAllFields.Update();
clientContext.ExecuteQuery();
}
}
public static bool FolderExists(Web web, string listTitle, string folderUrl)
{
var list = web.Lists.GetByTitle(listTitle);
var folders = list.GetItems(CamlQuery.CreateAllFoldersQuery());
web.Context.Load(list.RootFolder);
web.Context.Load(folders);
web.Context.ExecuteQuery();
var folderRelativeUrl = string.Format("/{0}/{1}", list.RootFolder.Name, folderUrl);
return Enumerable.Any(folders, folderItem => (string)folderItem["FileRef"] == folderRelativeUrl);
}
The sample code for extracting attachment from submitted InfoPath form
var lstTimeSheet = new List<RelatedTimesheet>();
foreach (var timeSheet in invoiceFormData.Summary.Timesheet)
{
if (timeSheet.Attachment != null)
{
var tSheet = new RelatedTimesheet();
var b = timeSheet.Attachment;
var nameBufferLen = b[20] * 2;
var fileNameBufffer = new byte[nameBufferLen];
for (var i = 0; i < nameBufferLen; i++)
{
fileNameBufffer[i] = b[24 + i];
}
var charFileName = Encoding.Unicode.GetChars(fileNameBufffer);
var fileName = new string(charFileName);
tSheet.FileName = fileName.Substring(0, fileName.Length - 1);
var fileContent = new byte[b.Length - (24 + nameBufferLen)];
for (var i = 0; i < fileContent.Length; i++)
{
fileContent[i] = b[24 + nameBufferLen + i];
}
tSheet.Attachment = fileContent;
lstTimeSheet.Add(tSheet);
}
}
public class RelatedTimesheet
{
public string FileName { get; set; }
public byte[] Attachment { get; set; }
}
Hi,
Had a requirement to split a List in 3 smaller lists.
For e.g. if a list has 13 different elements.
It has to split into 3 list containing 5, 5 and 3 elements in it.
The helpful post
Hope it helps !
Hi,
Recently had a requirement to document and show stack trace for a particular method to understand the flow
No better way to do it than through code map using Visual Studio
Bye..