all groups > dotnet remoting > march 2007 >
You're in the

dotnet remoting

group:

Send a word document


Send a word document lil J
3/19/2007 12:00:00 AM
dotnet remoting:
how can I send a word document over remoting from a client to a server?
i think, i have to stream the file, but i don't know how, and
how to put this stream together on the client

RE: Send a word document Mahesh Deo
3/20/2007 5:25:13 AM
If you want t otransfer word file over remoting there are two methods
1>transfer it byte by byte or 2>use file stream

if you want to transfer filestream you need to import System.IO namespace

Imports System.IO or in C# using System.IO following code is in c#

then create object of filestream

FileStrem s=new FileStram(@"d:\somelocation\WordFile.Doc",FileMode.Open)

this will give you filestream object which you can pass as it is over remoting


and on the other end you need to recounstruct wordfile as follows

declare on byte arry then read all bytes from your stream class into this
byte arry and save that byte arry to disk using File class and use,
File.WriteAllBytes(@"D:\MaheshDeo\pic\Mahesh1.doc", bytearry)


Byte[] b=new Byte[Stream.length];

for(inti=0;i<=Stream.lnegth;i++)
{
b[i]=Stream.readByte();
}


File.saveAllBytes(@"d:\SomeLocation\MyWordFile.doc",b);
--
Mahesh A Deo, MCP


[quoted text, click to view]
AddThis Social Bookmark Button