Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.4k views
in .NET FTP by (120 points)
Is there any way to download a file via a webpage such that the reponse stream gets sent to the user as the file is being downloaded from the server?

I'm testing the free version of edtFTPnet using FTPConnection. It works fine (meaning it does the downloads). I'm using the code below as suggted here http://www.enterprisedt.com/forums/view ... bpage#3496, but th problem is the file size is about 100MB and the user has to wait upwards of 10 minutes before they set a "Save File" prompt.

Any suggestions?

Response.Clear()
Response.ContentType = "application/octet-stream"

ftpConn.ServerAddress = "aaaaaaa"
ftpConn.UserName = "bbbbbbbb"
ftpConn.Password = "ccccccc"
ftpConn.Connect()
ftpConn.CloseStreamsAfterTransfer = False
ftpConn.DownloadStream(Response.OutputStream, "fileName")
ftpConn.Close()


fuzzlog

1 Answer

0 votes
by (51.6k points)
The forum article you refer to was unintentionally misleading and I've just edited it to make it clearer what's going on. Just so you know, that application doesn't allow you to perform FTP directly from within your browser. The FTP is performed on the server, which then gives you HTTP access to the data that it has downloaded via FTP. While the text was misleading, that doesn't mean that the method illustrated is not useful, and it may be exactly what some people are looking for.

Adding a progress bar is definitely non-trivial and I don't know if or how that would work. I thought I'd seen download progress bars for HTTP downloads on other websites, but Googling it just now didn't immediately return any results.

Have you seen Integral FTP? It allows you to do all that sort of stuff. It's HTML/Javascript and uses an invisible Java applet behind the scenes to do the actual transfers.

- Hans (EnterpriseDT)

Categories

...