We are programmatically attaching documents/attachments to the list item through a web-part.
I'm using the below code to accomplish this. (Fileupload control is rendered in the webpart)
Stream inputStream = this.fileUploadCtrl.PostedFile.InputStream;
byte buffer = new byte[inputStream.Length];
inputStream.Read(buffer, 0, (int)inputStream.Length);
The attachments are getting added fine. But in some cases, only the file is attached but not the contents. when we click on the attached file name, we get the following error:
"500 INTERNAL SERVER ERROR"
Has anyone encountered this issue? Any help is highly appreciated.
View Complete Post