Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Friday, 24 June 2011

NTLM authentication and 404 Errors

The last 2 times I've tried to deploy SharePoint 2010 I've come across a problem where I could not log in (due to repeated request to authenticate) or I received a 404 error.
To fix this, you have to add a DWORD in the server's registry:
By setting the DisableLoopbackCheck registry key. Follow these steps:

  •     Set the DisableStrictNameChecking registry entry to 1.
  •     Click Start, click Run, type regedit, and then click OK.
  •     In Registry Editor, locate and then click the following registry key:
  •     HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  •     Right-click Lsa, point to New, and then click DWORD Value.
  •     Type DisableLoopbackCheck, and then press ENTER.
  •     Right-click DisableLoopbackCheck, and then click Modify.
  •     In the Value data box, type 1, and then click OK.
  •     Quit Registry Editor, and then restart your computer.
However, rather follow the preferred method described here when fixing this problem on a live environment.

Thursday, 2 June 2011

Retrieving Attachments From a SharePoint List Item

Today I had to retrieve a SPListItem's attachments in some code. I noticed that the SPListItem has this nice property called Attachments. I thought, "Sweet, this'll be really easy.", but upon closer inspection, the SPAttachmentCollection returned by this property only stores the names of the files attached to the SPListItem.

I decided to read up a bit just to make sure I wasn't just retrieving the items in the wrong way and I stumbled upon ' blog post about the subject in which he explains that you still had to navigate to the SPList's subfolders in order to find the actual files.

So, the Attachments property is useless when trying to retrieve the SPListItem's attachments. Like one of my collegues says "I wonder of they eat a bowl of stupid in the mornings."