Shantha Kumar T
Uploading File from Local Machine to SharePoint ListItem as an attachment
To attach the file from Local Machine to SharePoint ListItem as an attachment, Import the System.IO namespace to use the Stream Class to read the file contents. Use System.Web.UI.WebControls.FileUpload control is named as fileUpload in code. Sample code for uploading the…