To troubleshoot and resolve this problem, you can consider the following steps: It's common for FTP servers to have security measures to limit access to certain IP ranges or to require authentication for downloading files. One possible reason for this issue is that the FTP server has some restrictions or access controls in place that prevent clients with dynamic IP addresses from accessing and downloading files. Thank you for your question and for reaching out with your question today.īased on the information provided, it seems that clients with dynamic IP addresses are experiencing issues downloading a file from the FTP server, while clients with static IP addresses can download the file successfully. StrLocalFile:="D:\town finance/text.txt", _ MsgBox "fail", vbInformation, "Pars Royan"įtpDownload strRemoteFile:="//public_ftp/text.txt", _ MsgBox "download ok", vbInformation, "Pars Royan" If FtpGetFileA(hConn, strRemoteFile, strLocalFile, 1, 0, FTP_TRANSFER_TYPE_UNKNOWN Or INTERNET_FLAG_RELOAD, 0) Then HConn = InternetConnectA(hOpen, strHost, lngPort, strUser, strPass, 1, 0, 2) HOpen = InternetOpenA("FTPGET", 1, vbNullString, vbNullString, 1) Sub FtpDownload(ByVal strRemoteFile As String, ByVal strLocalFile As String, ByVal strHost As String, ByVal lngPort As Long, ByVal strUser As String, ByVal strPass As String) Private Declare PtrSafe Function InternetCloseHandle Lib "wininet" ( _ Private Declare PtrSafe Function FtpGetFileA Lib "wininet.dll" ( _ Private Declare PtrSafe Function InternetConnectA Lib "wininet.dll" ( _ Private Declare PtrSafe Function InternetOpenA Lib "wininet.dll" ( _ Private Const INTERNET_FLAG_RELOAD As Long = &H80000000 Private Const FTP_TRANSFER_TYPE_UNKNOWN As Long = 0
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |