string FilePath = HttpUtility.UrlDecode(Request.QueryString.ToString());
string[] s = FilePath.Split(new char[] { ',' });
string path = s[0];
string FileName = s[1];
String str = HttpContext.Current.Request.Url.AbsolutePath;
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
// response.ContentType = "text/plain";
response.AddHeader("Content-Disposition", "attachment; filename=" + FileName+ ";");
response.TransmitFile(path+FileName);
response.Flush();
response.End();
위의 코드는 다른 페이지에서 오디오 파일의 위치를 얻는 코드입니다. 오디오 파일은 URL을 사용하여 액세스 할 수있는 원격 시스템에 있습니다. http : \ servername \ audiofiles \ filename.wav. response.Transmit 및 .WriteFile에는 가상 경로가 필요하지만, response.Write()에는 파일이 다운로드되지 않습니다. 어떻게 파일을 다운로드하는 대신 가상 경로의 절대 URL을 제공 할 수 있습니다절대 경로를 사용하여 클라이언트 측에서 파일 다운로드 .NET
내가 대화하지 WebClient를의 다운로드 기능으로 저장 사용하여 다운로드 할 것이다는 –