Saving a stream to a file

K

K Viltersten

I've downloaded a file from an FTP server and
using WebRequestMethods.Ftp.DownloadFile and the
result is, i guess, a file. However, the response is
of type FtpWebResponse and as such only have a method
for obtaining a Stream object only...

I'd like it to respond with an object of type File or
FileInfo, maybe, directly. Is it doable? Or is the
best way to do that simply using FileWriter?
 
A

Arne Vajhøj

K said:
I've downloaded a file from an FTP server and
using WebRequestMethods.Ftp.DownloadFile and the
result is, i guess, a file. However, the response is
of type FtpWebResponse and as such only have a method
for obtaining a Stream object only...

I'd like it to respond with an object of type File or
FileInfo, maybe, directly. Is it doable?

It has the methods it ha.

WebClient has some convenience methods like DownloadFile.

Arne
 
K

K Viltersten

I've downloaded a file from an FTP server and
It has the methods it ha.

WebClient has some convenience methods like DownloadFile.

Right, thanks! I was hoping for a neat one-liner
doing everything automagically for me. :)

Perhaps i'm getting too convenient, hehe.
 

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

Top