Gemini WebServices API - PDF Attachment
Hello,
I need help creating a PDF attachment to be added to an issue. If I do it the way I normally do it with other file types, once I try it to open it within an issue in Gemini, I get an error indicating that the file may be damaged.
This is how I normally create an attachment:
--------------------------------------------------
String attachFile = System.IO.Path.GetFullPath(pdfFileFullName);
Stream file = new FileStream(attachFile, FileMode.Open, FileAccess.Read);
// Create a new file entity.
FileEN feFile = new FileEN();
// Set the data.
// Comment ID 0 is for issue attachments.
feFile.CommentID = 0;
feFile.ProjectID = 20;
feFile.FileName = attachFile;
feFile.ContentLength = Convert.ToInt32(file.Length);
byte[] abFileContent = new Byte[feFile.ContentLength];
file.Read(abFileContent, 0, feFile.ContentLength);
------------------------------------------------------------------
Thanks for any help you can provide.
ksteel
· 1 |
|
Friday, October 16, 2009, 2:41:47 AM |