if (ct.Attachment != null) { ct.DocumentName = ct.Attachment.ToString(); byte[] contents = GetFileStream(); if ((ct.DocumentName != null) && (contents.Length > 0)) { SPAttachmentCollection fileAttach = empCertificationitem.Attachments; if (ct.TemAttachmentName == System.IO.Path.GetFileName(ct.DocumentName)) { empCertificationitem.Attachments.Delete(System.IO.Path.GetFileName(ct.DocumentName)); fileAttach.Add(ct.DocumentName, contents); } else { fileAttach.Add(ct.DocumentName, content...