Download files with ina web service and use it furthur

A

apondu

Hi,
I am new to web services and i am facing a problem.

I am interested in downloading some file from internet and use it for
furthur processing For eg. i have a file at a the following URL and i
want to download that file in the web service which i am coding and
use it for furthur.

In normal window application i can achieve this by the following
code


link : http://www2.parc.com/csl/members/woodruff/publications/1996-Woodruff-WWW5-WWW.pdf

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,fileName);



But if i try to achieve the same thing in web service using c#.net
with the following code i am not able to do it.

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,Server.MapPath(fileName));

can some one suggest me how to achieve the it web services.I am also
intrested in furthur performing some operation on this file for
example reading the data from the file and use it.

Thanks for the help.

This is my mail-id : (e-mail address removed)

Regards,
Govardhan
 
R

Rad [Visual C# MVP]

Hi,
I am new to web services and i am facing a problem.

I am interested in downloading some file from internet and use it for
furthur processing For eg. i have a file at a the following URL and i
want to download that file in the web service which i am coding and
use it for furthur.

In normal window application i can achieve this by the following
code

link : http://www2.parc.com/csl/members/woodruff/publications/1996-Woodruff-WWW5-WWW.pdf

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,fileName);

But if i try to achieve the same thing in web service using c#.net
with the following code i am not able to do it.

WebClient WC=new WebClient();

string fileName = "c:\\" + link.Substring(link.LastIndexOf("/")+1);

WC.DownloadFile(link,Server.MapPath(fileName));

can some one suggest me how to achieve the it web services.I am also
intrested in furthur performing some operation on this file for
example reading the data from the file and use it.

Thanks for the help.

This is my mail-id : (e-mail address removed)

Regards,
Govardhan

Why are you not able to do it? What error message are you getting, if any?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top