473,508 Members | 2,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Downloading files woth in a web service and use t for furthue processing

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/woo...f-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 : ap****@gmail.com

Regards,
Govardhan

Apr 3 '07 #1
1 1674
A Web Service is a form of distributed application in which a client makes
method calls to a Web Service. Since a method cannot return a file, a Web
Service cannot return a file. What you are asking is similar to asking how
to get apples from an orange tree.
--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"apondu" <ap****@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
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/woo...f-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 : ap****@gmail.com

Regards,
Govardhan

Apr 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2319
by: Reimar Bauer | last post by:
Dear all I recognized today that if I have an echo statement on an else at the end of my script the only thing which was downloaded by wget was this string. Is this a common way to prevent...
8
2987
by: MattP | last post by:
Ok, with the help of some examples found on the web and some minor modifications on our own, we have a simple and working encrypt and decrypt solution. It runs as a service, watches for files with...
4
2917
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
8
14129
by: Ken | last post by:
Can anyone point me to some info, which gives me an idea of how to go about making an ASP.NET web service to download files I plan to access the web service from a C# Windows App. Thanks. ...
0
986
by: Bryan | last post by:
i'm trying to just download the turbogears eggs without installing it. i've read the turbogear install instructions and the easy_install help. from the easy_install web site: If you have...
1
1878
by: Jens Jensen | last post by:
Hello, I use the code below to zip files to a single .zip destination. I get the expected result when i work on my developement machine (WinXP sp.2). When i deploy the web application which...
35
9298
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
1
1513
by: apondu | last post by:
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...
7
2650
by: Laszlo Nagy | last post by:
Hello, I have a win32 service written in Python that starts a plain application, written in Python. The win32 service tries to launch the application in a while loop and logs the return value...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.