Groups | Blog | Home
all groups > c# > september 2007 >

c# : How do I upload files using remoting?


Karthik D V
9/17/2007 10:38:04 PM
Hi Friends,

How do I upload files using remoting?

Thanks
Arnshea
9/18/2007 6:08:47 AM
[quoted text, click to view]

One way to do this is to have a method on the server like:

int Write(string filename, byte[] buf, int fileOffset)

that returns the number of bytes written.

The client then reads the contents of the file to upload and
repeatedly calls the remote Write() method to send the contents to the
server. You can either use -1 as a fileOffset to indicate EOF or have
a separate Close() method.

The .net framework help has a remoting sample that would be a good
starting point. Add the Write() method to the sample remotable
object. See "Programming with the .NET Framework - Accessing objects
in Other Application Domains - .NET Remoting Overview - Building a
Basic .NET Remoting Application"
John Timney (MVP)
9/18/2007 1:28:52 PM
you could use DIME
http://www.codeproject.com/cs/webservices/remotingdime.asp

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


[quoted text, click to view]

SomeOneIThink
12/9/2007 6:41:05 PM

Is there anyway to call a remote method that returns a byte[]?
By doing byte[] file = File.ReadAllBytes(); or something? And then on
the client do File.WriteAllBytes(string path, byte[]
byteArrayToWrite);?? Just wondering.


--
SomeOneIThink
------------------------------------------------------------------------
SomeOneIThink's Profile: http://www.techtalkz.com/member.php?userid=12574
View this thread: http://www.techtalkz.com/showthread.php?t=83671

Posted via http://www.techtalkz.com - Technology & Computer Troubleshooting Forums
AddThis Social Bookmark Button