• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

download a file on server

i have a web application which runs on a particular server

this application is made using asp.net with c# codebehind

whenever a client accesses a page, i want the server to download a file from another server

example:
application hosted on server A
when client C access the application on server A, i want server A to download a file from server B


currently what is happening is that the file is getting downloaded on the client's machine itself


please help


WebClient Client = new WebClient();
       Client.DownloadFile("http://www.bloombergutv.com/globalindices.xml", "c:\\Inetpub\\wwwroot\\Connect2\\globalindices.xml");

Open in new window

0
RakeshBhandari
Asked:
RakeshBhandari
1 Solution
 
guru_samiCommented:
try this:
Client.DownloadFile("http://www.bloombergutv.com/globalindices.xml", Server.MapPath("~/globalindices.xml"));

0
 
RakeshBhandariAuthor Commented:
thanks!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now