473,587 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

get a remote file via http

I need to get a remote file via http protocol, get it in some variable and
use with some unzipping tool to get the content.

So the problem I've is two. First how to read a remote file. I found that I
can access to a file with the WebRequest class, and it get, but I don't
know if the result is just the data collected in the property, or a sort of
stream ready to be used. There is the GetResponseStre am that should do
this, but just after encapsulate the returned stream in a stream variable I
don't know how proceed.

Some links that can help me understand the streaming or better this kind of
logic I want to implement?

After all ... suppose to have the stream ... how to unzip it? I looked for
some free as well commercial component that is able to unzip a memory
stream. It doesn't seem to exist one. May be the exceed component, but I'm
not sure the stream they referer to is what I want.

Any helps also in this case?

Thanks in advance.

Andrea
Nov 19 '05 #1
2 1240
A stream is just a stream whether it is a FileStream or a NetworkStream.
You just need to extract the bytes from the stream. Here is an article that
shows how to download a file?
(http://www.c-sharpcorner.com/interne...ledownload.asp)

There is an opensource library called SharpZipLib that processes zip file.
I do not know if it can unzip from a stream since I have never used it, but
if nothing else, you can always save to a temp file, then process the file
with the library.

"Andrea Moro" <mo********@tis cali.it> wrote in message
news:us******** *************** ****@40tude.net ...
I need to get a remote file via http protocol, get it in some variable and
use with some unzipping tool to get the content.

So the problem I've is two. First how to read a remote file. I found that I can access to a file with the WebRequest class, and it get, but I don't
know if the result is just the data collected in the property, or a sort of stream ready to be used. There is the GetResponseStre am that should do
this, but just after encapsulate the returned stream in a stream variable I don't know how proceed.

Some links that can help me understand the streaming or better this kind of logic I want to implement?

After all ... suppose to have the stream ... how to unzip it? I looked for
some free as well commercial component that is able to unzip a memory
stream. It doesn't seem to exist one. May be the exceed component, but I'm
not sure the stream they referer to is what I want.

Any helps also in this case?

Thanks in advance.

Andrea

Nov 19 '05 #2
Andrea Moro wrote:
I need to get a remote file via http protocol, get it in some
variable and use with some unzipping tool to get the content.

So the problem I've is two. First how to read a remote file. I found
that I can access to a file with the WebRequest class, and it get,
but I don't know if the result is just the data collected in the
property, or a sort of stream ready to be used. There is the
GetResponseStre am that should do this, but just after encapsulate the
returned stream in a stream variable I don't know how proceed.

Some links that can help me understand the streaming or better this
kind of logic I want to implement?


In addition to Peter's post, note that there's also
WebClient.Downl oadFile() and .DownloadData() , which are simpler to use
than WebRequest.

Cheers,
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Nov 19 '05 #3

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

Similar topics

0
3281
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others.
1
3885
by: POnfri | last post by:
Hi, I have a problem in a peace of code were i'm doing a file copy using File.Copy. The Source is local and the target is a remote machine. Example: File.Copy(C:\temp\hi.txt, \\myremote\c$\temp\hi.txt, true); This API is run from a web service that exposes it. The problem is as follows: 1) I request a page (On the web service machine)...
2
2184
by: Jeff | last post by:
I have an ASP.NET web page accessing a SQL database. I've used VS to build the app and stored it in the eNPTest02 directory of my localhost on my development machine. The database is on the web. I've found a way that works on the web, and I'm trying to get it to also work in debug mode in the IDE. The "on the web" page and my SQL database...
4
4210
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be change that the application will be able to run on any other machine (using \\ syntax on the run command- not a problem) using the DB located on a...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7973
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.