![]() Private Declare Function InternetCloseHandle Lib "wininet" ( _ Private Declare Function FtpGetFileA Lib "wininet.dll" ( _ Private Declare Function InternetConnectA Lib "wininet.dll" ( _ Private Declare Function InternetOpenA Lib "wininet.dll" ( _ Private Const INTERNET_FLAG_RELOAD As Long = &H80000000 Private Const INTERNET_FLAG_PASSIVE As Long = &H8000000 Private Const INTERNET_SERVICE_FTP As Long = &H1 As Martin mentioned, using passive mode is the key. The plan of using InternetConnectA Lib "wininet.dll" eventually works through WAN PC to access the FTP server with VBA scripts. I suspect that I should do something with FTP commands to enable the WAN pc access the FTP server correctly. Noted that, the WAN pc works well with Filezilla Client access. My question is what kind of reason could bring the failure? how should I fix it? Use Filezilla Server to replace IIS FTP, but the result is the same. What I have tried to replace some parts of the above setup include: (.frozen still.)įtp> quote pasv (Try again with passive mode)Ģ27 Entering Passive Mode (94,14,216,186,196,105).ġ50 Opening ASCII mode data connection. (Ctrl+C to quit)ġ50 Opening BINARY mode data connection. (.frozen here.)Īborting any active data connections. WAN PC FTP command line downloads the FTP server's file.įtp> Get \CalData\22-12-21.txt C:\Downloads\CalData\22-12-21.txtġ50 Opening ASCII mode data connection. WAN PC Filezilla Client login and download the FTP server's file. ![]() LAN PC FTP command line downloads the FTP server's file įtp> Get "\CalData\22-12-21.txt" "C:\Downloads\CalData\22-12-21.txt"ġ25 Data connection already open Transfer starting.įtp: 1065 bytes received in 0.04Seconds 23.67Kbytes/sec.What I have tested successfully includes: Routers firewall and forwarding service. ![]() (Later I should move it to a VPS for more stable running) The server which I set up at my home local network(experimental period), provides FTP service to internet users. I'm trying to build up Excel VBA programmatically and expect it could download some files from the server via the FTP command line. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |