Add atachment

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

Moderator: SourceGear

Locked
bobby_avram
Posts: 5
Joined: Fri Nov 10, 2006 8:34 am

Add atachment

Post by bobby_avram » 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?

bobby_avram
Posts: 5
Joined: Fri Nov 10, 2006 8:34 am

Post by bobby_avram » 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'

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » 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
SourceGear

Locked