0
Reply

Dime Attachment with Wse 2.0 ?

Hans Graus

Hans Graus

Aug 8 2005 12:18 PM
2.8k
Hi, i work with the Visual Studio 2003 und i have a C# - WebApplication in which i make a stream from a *.doc file send this stream to a webservice and make then again a file from it... Here the Code-snippets Code WebForm1: ... DimeAttachment attachment = new DimeAttachment("application/msword", TypeFormat.MediaType, this.filUpload.PostedFile.InputStream); w.RequestSoapContext.Attachments.Add(attachment); w.Upld(); ... A WebMethod "Upld" takes then the stream and makes a *.doc file from it... Code Upld(): ... FileStream fs = File.Create(HttpContext.Current.Server.MapPath("LatestDoc.doc")); long docLength = RequestSoapContext.Current.Attachments[0].Stream.Length; byte[] buffer = new byte[docLength]; RequestSoapContext.Current.Attachments[0].Stream.Read(buffer, 0, (int)docLength); fs.Write(buffer, 0, (int)docLength); fs.Close(); ... But now i want to send the stream to webservice first, which only has a webreference to another webservice. This last webservice then makes the *.doc -file and the second webservice shall only forward the stream without creating a file (for performance reasons)! Has anyone an idea,how to make this ? Thx T.