Annonymous website : Sharepoint list form with multiple attachments upload

Mercury Man 21 Reputation points
2021-01-25T12:14:08.99+00:00

Hi All,

We have SharePoint on-premises 2016 environment and we have SharePoint website publicly accessible for all anonymous users. I have a requirement to add a page which will have to capture user complaints with five attachments option with total file size of 10MB.

  • Should I user Rest API for this request? if yes any example.
  • SharePoint Object Model?
  • Server side

Can someone please guide me here.

Microsoft 365 and Office SharePoint Server Development
{count} votes

3 answers

Sort by: Most helpful
  1. MichaelHan-MSFT 18,126 Reputation points
    2021-01-26T02:48:21.23+00:00

    Hi @Mercury Man ,

    By default, we can attach multiple files to a list item in SharePoint, but can choose only one at a time.

    60449-image.png

    If you want to choose mutilple files to attach at a time, you could refer to this article: https://www.c-sharpcorner.com/article/attach-multiple-files-to-sharepoint-list-item-with-default-attachment-of-new-for/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Mercury Man 21 Reputation points
    2021-01-27T11:01:12.14+00:00

    Hi MichaelHan-MSFT,

    Yes, I am aware of the SharePoint list attachment but I have an anonymous site and I would like to create a complaint form for the users so that they can attach multiple files. I have tried rest API but could not do so. any other way? please suggest

    0 comments No comments

  3. MichaelHan-MSFT 18,126 Reputation points
    2021-01-28T07:51:21.96+00:00

    Hi @Mercury Man ,

    I understand that you want to enable anonymous users to upload files to SharePoint. However it's by design behavior in SharePoint that anonymous users are prohibited from upload files(including attach files to list item). This is done as a security precaution.

    You could refer to the similar threads:

    https://social.technet.microsoft.com/Forums/en-US/82ba2da4-086f-4cb9-a68b-2741a695fcea/anonymous-users-cannot-attach-files-to-a-list?forum=sharepointadminprevious

    https://social.technet.microsoft.com/Forums/sharepoint/en-US/5cc0a173-16fe-45ce-88a6-ae9dfe19953b/anonymous-user-want-to-attach-items-to-sharepoint-list?forum=sharepointadminprevious

    To achieve your requirments, Rest API would not work for you, you need to use sever side code to achive this. Use the RunWithElevatedPrivileges method to upload files:

    https://stackoverflow.com/questions/10204040/how-to-allow-file-upload-for-anonymous-user-in-sharepoint

    http://andreaswijayablog.blogspot.com/2014/04/sharepoint-2013-anonymous-access-add.html


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.