Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Gemini WebServices API - PDF Attachment

web-app

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
ksteel
Replies (2)
helpful
0
not helpful

That should work. Can it be that an anti virus is causing this?

Can you attach the same file via the web app?


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Hello,

Digging deeper into how Gemini attaches files via web app, I found that the following line is required to make it work:

feFile.FileData = abFileContent;

That did it. Thanks.

 


ksteel
· 1
ksteel