I was thinking to dump an XML file generated from server to a random client requesting that. The problem is that I have to damp that file in a specific folder of clients ( C:/Application/POSMachine/WaitingXML ), for there is another application listening to that folder.
My approach :
Request.GetOwinContext().Request.RemoteIpAddress
Any comments and better implementation is appreciated.
It would be a security risk to allow a website to download a file to an arbitrary location (that would mean a malicious website could just download a new svchost.exe to C:\\Windows\\System32 or what not)
Also your idea with running a service would not work in all cases, since your clients will most probably be behind a modem/router/NAT switch (or multiple). All these devices would have to be configured for port forwarding. So, you really need an 'client-outbound' connection (like a browser does).
I would implement a client program which can contact your server and download the file with a System.Net.WebRequest
and save to the specific location. Another possibility might be to add a System.Windows.Forms.WebBrowser
control and handle the FileDownload
event. However, your question does not contain enough information to more specific (how does the client chose a file to download)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.