|
-
Mar 29th, 2019, 01:57 PM
#23
Re: VB6 Simple Async-Download-Ctl for multiple Files
 Originally Posted by yinxiaodan
Does RC5 have the function of FTP upload and download with password?
No FTP-Upload-feature is encapsulated in a convenience-class, no...
For the Download-direction though, you could try the cDownloads-Class (just tested this again on Win10 with my own FTP-server successfully):
Code:
Option Explicit
Private WithEvents DLs As cDownloads
Private Sub Form_Load()
Dim Host: Host = "MyHostDomain.de"
Dim Path: Path = "/pdf/SomePdfFile.pdf"
Set DLs = New_c.Downloads
DLs.Download "ftp://" & Host & Path, dl_FTP, , , "MyUsername", "MyPassword"
End Sub
Private Sub DLs_DownloadStart(DownloadObj As cDownload)
Debug.Print "DL-Start with URL: " & DownloadObj.URL
End Sub
Private Sub DLs_DownloadProgress(DownloadObj As cDownload, ByVal Percent As Single, ByVal StatusCode As Long, StatusDescription As String, StatusValue As String)
Debug.Print "DL-Progress with URL: " & DownloadObj.URL, Percent, StatusCode, StatusDescription, StatusValue
End Sub
Private Sub DLs_DownloadComplete(DownloadObj As cDownload, ByVal ErrNum As Long, ErrString As String)
Debug.Print "DL-Complete with URL: " & DownloadObj.URL, ErrNum, ErrString, DownloadObj.GetContentLen
End Sub
Note, that the cDownloads-Class is not a "full FTP-Client" (it's "true to its name" - and does only downloads...
e.g. it does not support Dir-Listings - and so you will have to know the Filename and Path beforehand on your FTP-Server).
FWIW - I've uploaded a fully implemented FTP-Client of mine here:
http://www.vbforums.com/showthread.p...n-Winsock-ocx)
This is > 20 years old code, based on the Winsock.ocx - but with full control over the FTP-command-channel -
Maybe that helps already - but it's surely not the only VB6-FTP-client-implementation when you google a bit...
In case you need this for your own WebHosting (to synchronize between local Files and your production-environment)...
the first thing I've done on my own WebHost was, to implement appropriate *.asp-Scripts, which allowed me Dir-Listings and File-Transfers directly and secure via https.
So, personally I try to avoid FTP-stuff as often as I can - it's old-fashioned - and only secure with extensions like FTPS or SFTP -
and firewall-wise always a nightmare to "configure and make work" at some customer.sites (especially when some customers have thrown Proxies into the mix in addition).
Olaf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|