// Liz E - the attachment does not seem to be working properly. a link is provided int eh feedback for the attachment but the data is not there. // I am seeking assistance throught he HockeyApp discussions. In the meantime, disabling this and attaching the info as part of the message if it is a text file. private List <IFeedbackAttachment> GetFileAttachmentList() { List <IFeedbackAttachment> attachmentList = new List <IFeedbackAttachment>(); try { // HockeyApp allows multiple attachments. If we change Attachment file to allow a list, then this will need to be modified. if (!string.IsNullOrEmpty(AttachmentFile) && File.Exists(AttachmentFile)) { byte[] dataBytes = File.ReadAllBytes(AttachmentFile); string contentType = ""; if (AttachmentFile.EndsWith("txt") || AttachmentFile.EndsWith("log")) { contentType = "text/plain; charset=utf-8"; } // if we decide to allow images for screen shot, for example // else if (IsImage(AttachmentFile)) // { // contentType = <whatever we need for image attachment>; // } // create IFeedbackAttachment in a list IFeedbackAttachment feedbackAttachment = new HockeyApp.Model.FeedbackAttachment(AttachmentFile, dataBytes, contentType); attachmentList.Add(feedbackAttachment); } return(attachmentList); } catch (Exception ex) { // we were note able to access the file data, return empty attachment list return(attachmentList); } }
// Liz E - the attachment does not seem to be working properly. a link is provided int eh feedback for the attachment but the data is not there. // I am seeking assistance throught he HockeyApp discussions. In the meantime, disabling this and attaching the info as part of the message if it is a text file. private List<IFeedbackAttachment> GetFileAttachmentList() { List<IFeedbackAttachment> attachmentList = new List<IFeedbackAttachment>(); try { // HockeyApp allows multiple attachments. If we change Attachment file to allow a list, then this will need to be modified. if (!string.IsNullOrEmpty(AttachmentFile) && File.Exists(AttachmentFile)) { byte[] dataBytes = File.ReadAllBytes(AttachmentFile); string contentType = ""; if (AttachmentFile.EndsWith("txt") || AttachmentFile.EndsWith("log")) { contentType = "text/plain; charset=utf-8"; } // if we decide to allow images for screen shot, for example // else if (IsImage(AttachmentFile)) // { // contentType = <whatever we need for image attachment>; // } // create IFeedbackAttachment in a list IFeedbackAttachment feedbackAttachment = new HockeyApp.Model.FeedbackAttachment(AttachmentFile, dataBytes, contentType); attachmentList.Add(feedbackAttachment); } return attachmentList; } catch (Exception ex) { // we were note able to access the file data, return empty attachment list return attachmentList; } }