Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI
Is there any working solution for how to Run an URL inside a WCF webservice, the URL return a mp3/zip file.

and output of the web service also return those mp3/zip file with prompt "open/save" options in the browser.

my aim to be restrict End user not to know the actual download URL.

I am using below code, but this will not asking for prompt(open/save), i need to specify the path . it get fails if that path not found in PC.


ex: http://download.microsoft.com/download/C/9/4/C94B7FA8-E35F-4C96-8B35-7B183918298F/HDI_ITPro_MSDN_mp3_Installing_ASP_NET_and_Tools_v2.mp3

C#
string remoteUri ="http://download.microsoft.com/download/C/9/4/C94B7FA8-E35F-4C96-8B35-7B183918298F/HDI_ITPro_MSDN_mp3_Installing_ASP_NET_and_Tools_v2.mp3";
        string fileName = AppDomain.CurrentDomain.BaseDirectory +"\download\Tools_v2.mp3", myStringWebResource = null;
        WebClient myWebClient2 = new WebClient();
        myStringWebResource = remoteUri + fileName;
        myWebClient2.DownloadFile(myStringWebResource, fileName);
Posted
Updated 7-Oct-12 19:56pm
v3

1 solution

You need to use streaming for large data file.

Here is a msdn link,
http://msdn.microsoft.com/en-us/library/ms733742.aspx[^]

cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900