Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET WebService
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
 
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 7-Oct-12 19:23pm
Edited 7-Oct-12 19:56pm
v3

1 solution

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

Solution 1

You need to use streaming for large data file.
 
Here is a msdn link,
http://msdn.microsoft.com/en-us/library/ms733742.aspx[^]
 
cheers
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 364
1 Nirav Prabtani 268
2 _Amy 230
3 Sergey Alexandrovich Kryukov 171
4 CHill60 170
0 OriginalGriff 8,004
1 Sergey Alexandrovich Kryukov 7,017
2 Maciej Los 4,039
3 Peter Leow 3,738
4 CHill60 2,912


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 8 Oct 2012
Copyright © CodeProject, 1999-2014
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