Click here to Skip to main content
13,000,742 members (45,554 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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.


string remoteUri ="";
        string fileName = AppDomain.CurrentDomain.BaseDirectory +"\download\Tools_v2.mp3", myStringWebResource = null;
        WebClient myWebClient2 = new WebClient();
        myStringWebResource = remoteUri + fileName;
        myWebClient2.DownloadFile(myStringWebResource, fileName);
Posted 7-Oct-12 19:23pm
Updated 7-Oct-12 19:56pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to use streaming for large data file.

Here is a msdn link,[^]


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100