473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 GetResponseStream 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 1231
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********@tiscali.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 GetResponseStream 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
GetResponseStream 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.DownloadFile() and .DownloadData(), which are simpler to use
than WebRequest.

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

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

Similar topics

0
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...
1
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,...
2
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. ...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.