PC Review


Reply
Thread Tools Rate Thread

Copy a file from client to server

 
 
annamanthadoo@gmail.com
Guest
Posts: n/a
 
      8th Feb 2007
can anyone help me
i need to copy a file (.txt) from a client to a sever in C#

 
Reply With Quote
 
 
 
 
Nick Malik [Microsoft]
Guest
Posts: n/a
 
      9th Feb 2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> can anyone help me
> i need to copy a file (.txt) from a client to a sever in C#
>


a couple of different techniques, depending on the situation.

You didn't say if the server is in the same domain as the client. In other
words, is this inside a corporate network? If so, simply use UNC path names
to copy the file using built-in methods in the framework. See
System.IO.File.Copy
http://msdn2.microsoft.com/en-us/library/system.io.file.copy(VS.80).aspx

If you are on different networks, then you need the server to have a
protocol running to accept the file. Two most common are FTP and HTTP (Web
Server).

For FTP, see this:
http://msdn2.microsoft.com/en-us/library/system.net.ftpwebrequest(VS.80).aspx

If you want to upload to a web server, then you will need to post the file
to the web server. Since you have client code, you won't be doing this from
a web page, but that doesn't mean you cannot use the web protocols. If you
want to look into this route, start with:
http://msdn2.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx

I hope this helps,

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browse client Directory to a specific folder and ftp the file from server to client bindu_conacle@yahoo.com Microsoft ASP .NET 1 26th Feb 2006 11:34 AM
question refined - Copy file from client to server =?Utf-8?B?Q0dX?= Microsoft Dot NET 9 8th Feb 2006 09:29 PM
File copy from client to server, newbie question =?Utf-8?B?Q0dX?= Microsoft Dot NET 3 7th Feb 2006 09:16 PM
How to copy a file from server to client Shayer Microsoft C# .NET 5 31st Aug 2003 09:47 AM
File copy between terminal server(windows 2000 server) and remote desktop client sivaraj Microsoft Windows 2000 Terminal Server Clients 1 23rd Jul 2003 01:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:23 AM.