开发者

Download Docx file from local server machine to client?

In c# I've assigned to write code for download and upload docx file from local server machine to the same local client machine. Let me explain clearly,

For example: If i need to send docx file (C:\sample.docx ) to client machine into directory(D:\sample) using web server(Here using apache tomcat) .. Here using httpwebrequest & httpwebresponse classes..

Is there any possible to find out the solution? Trying simple client - s开发者_高级运维erver application, It’s like a file sharing (Server assign word file to client and then client download that assigned file), I'm done with sockets-TCP/IP that’s works really fine. But trying to work out using http...


You cound not send something for Server to Client. Client have to request, Server have to respond.

This is a rather simple task. You can just place your file into web site folder (~/sites/mysite/simple.docx), if appache is configured and you requested http://mysite/simple.docx, file would be returned as response.

WebClient class DownloadFile method is very suitable for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜