Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2005

Tip: Looking for answers? Try searching our database.

How to send whole file between server's and client's side?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
schnitzell - 29 Aug 2005 15:59 GMT
Hi,

I need to send file between Client and Service.
How to do it?
For example:
I imagine that I should make public method (on the server side)
returning sometning like StreamReader object,
and on the client side I should to call this method.

Is it good way?

Thanks.
Greetings.
Michael Nemtsev - 30 Aug 2005 09:19 GMT
Hello schnitzell,

U should return array of bytes.

For example the server side code

using System.IO;

{
   public byte[] Contents;
   public string FilePath = @"c:\1.exe";

   Stream s = File.Open(FilePath, FileMode.Open);
   Contents = new byte[s.Length];
   s.Read(Contents, 0, (int) s.Lenght);
   s.Close();
   // add support of getting file properties)
   ...
   return Contents;
}

On the client perform vice versa operations, create File and write data from
Contents variable

s> I need to send file between Client and Service.
s> How to do it?
s> For example:
s> I imagine that I should make public method (on the server side)
s> returning sometning like StreamReader object,
s> and on the client side I should to call this method.
s> Is it good way?
s>
s> Thanks.
s> Greetings.
---
WBR,
Michael  Nemtsev

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.