I have problem with my SharePoint 2013 webpart where anonymous user can't download document from the library.

I already enabled the SharePoint anonymous user and enabled the anonymous authentication in IIS. But still it does not give permission for anonymous.

I checked the anonymous authentication through PowerShell it returns false. I also tried to enable it through PowerShell but still nothing. When I tried with my intranet it work perfectly fine.

  • Go to List Settings >Advanced settings and verify if you have checked "Yes" for "Allow items from this list to be downloaded to offline clients?" – Akshay Randive May 26 '15 at 4:08

My understanding is you are creating a custom webpart and writing code to download some files from a document library and configured the webpart on an anonymous page for anonymous users to allow them to download the files from some secured document library. If I am correct, please make sure you are elevating the privileges. Wrap your code with the following code snippet

SPSecurity.RunWithElevatedPrivileges(delegate() {


The above solution applies if you want to allow the anonymous users to download the files from a secured library.

Let me know if you have any questions.

| improve this answer | |
  • The code has already been added. Thw webpart runs in sharepoint 2010 was totally fine but migrated to sharepoint 2013, the anonymous user can download and redirect back to login page. – Fai May 26 '15 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.