Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Downloading a File From a Web Server
Message
 
À
16/06/2004 10:38:12
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00914066
Message ID:
00915377
Vues:
7
You might want to check out this article:

http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm

which talks in great deatail about WebRequest and provides a simple wrapper for retrieving content to string and file and posting data to the server.

If you just want to retrieve a simple file look into the WebClient class which has a simplistic HTTP interface that works for the basics.

+++ Rick ---

>Thanks again for your response.
>
>You were correct in that we are trying to download an Excel file from a site, and save it on our server.
>
>We're still struggling to get this to work. Here's what we're playing around with:
>
>
>WebRequest request = WebRequest.Create("http://tonto.eia.doe.gov/oog/ftparea/wogirs/xls/psw18vwall.xls");
>request.Timeout = 10000;
>WebResponse response = request.GetResponse();
>String s = response.ContentType;
>Stream str = response.GetResponseStream();
>
>
>As we step through this, we're seeing the value of str.length equaling an "error". We're new to this class, and we're struggling to find relevant documentation (searched MSDN, UT, others). We're not sure if we're on the right track, and if we are, we don't know where to go! Any thoughts would be appreciated!
>
>Thanks,
>
>David
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform