Add atachment

If you are having a problem using Dragnet, post a message here.

Moderator: SourceGear

Posts: 5
Joined: Fri Nov 10, 2006 8:34 am
PostPosted: Mon Nov 13, 2006 9:59 am
Is there a way to attach more than a single file to an given request?
I try to attach a file programmatically this way:

MantisItemAttachmentFullDetail attachment;
System.IO.Stream stream;

attachment = new MantisItemAttachmentFullDetail();
stream = new FileStream(directoryName + "/" + filesInfo[i].Name, FileMode.Open);
attachment.AttStream = stream;

and I receive a cast error from System.Io.Stream to Dragnet.Stream

Does anyone know how to add a file programmatically and not with the FileUpload control?

Posts: 5
Joined: Fri Nov 10, 2006 8:34 am
PostPosted: Mon Nov 13, 2006 10:11 am
With this code:

System.Web.UI.HtmlControls.HtmlInputFile fileUpload; //assuming this control is on the ASP.NET page

attachment.AttStream = fileUpload.PostedFile.InputStream;

I get the following error:
Cannot implicitly convert type 'System.IO.Stream' to 'TSF.Bugtracker.Dragnet.Stream'

Posts: 3584
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
PostPosted: Tue Nov 14, 2006 9:00 am
Sorry. Attachments and streams are currently not supported through the Dragnet Web service, and cannot be uploaded through the Web Service interface.
Jeff Clausius

Return to Support (Dragnet)

Who is online

Users browsing this forum: No registered users and 1 guest