Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET WebService
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 20:23pm
Edited 7-Oct-12 20: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
0 Sergey Alexandrovich Kryukov 195
1 Peter Leow 130
2 Zoltán Zörgő 120
3 CPallini 70
4 Atish K. Singh 55
0 Sergey Alexandrovich Kryukov 9,568
1 OriginalGriff 6,901
2 Peter Leow 4,737
3 Zoltán Zörgő 4,404
4 CHill60 2,932

Advertise | Privacy | Mobile
Web04 | 2.8.150129.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2015
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