Setting FTP upload as "passive"
How would I set my FTP uploads in my exe form active to passive?
I emailed tech support to ask about how I can get around for my files to upload correctly and they said it needs to be passive.
help?
Edit:
I found this .bas that says it'll allow FTP client in Passive but I'm not quit sure how to add it into my project.
http://www.thevbzone.com/modWININET.bas
Re: Setting FTP upload as "passive"
Not sure this helps, FTP app I made long-long time ago for a friend uses passive, heres a snippet,
'Connect to Server
hConnection = InternetConnect(hOpen, TxtFTP_Server, INTERNET_INVALID_PORT_NUMBER, TxtUser, TxtPassword, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0)
Re: Setting FTP upload as "passive"
It's useful... If I knew how to make it work within my project and with inet and how exactly to set it up properly.
I'm still a bit new to VB.
I just need to figure out how to get the upload function to work properly.
Re: Setting FTP upload as "passive"
Well, I found this thread:
http://www.vbforums.com/showthread.p...ht=passive+ftp
I was messing around with the code, I referenced the .dll to my project and after that..
I'm lost.
All I need is the upload function but I do not know where to place everything.
Excuse my VB newbie-ness.
Re: Setting FTP upload as "passive"
try searching the forum there have been many examples posted
i remember posting an example using passive
Re: Setting FTP upload as "passive"
I've already done that.
I'm just not understanding it I guess.
Re: Setting FTP upload as "passive"
if found this in previous post http://www.vbforums.com/showthread.p...tp+api+passive
download module from http://www.vbforums.com/showpost.php...09&postcount=8 add module to your project
vb Code:
Dim session As Long, server As Long, ftpserver As String, user As String, pass As String
Dim ret As Long, localfile As String, remotefile As String
ftpserver = ' your ftp server
user = 'login name
pass = 'password
localfile = App.Path & "\" & fname
remotefile = fname
session = InternetOpen(App.EXEName, INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, INTERNET_FLAG_NO_CACHE_WRITE)
server = InternetConnect(session, ftpserver, INTERNET_INVALID_PORT_NUMBER, user, pass, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0)
ret = FtpPutFile(server, localfile, remotefile, FTP_TRANSFER_TYPE_BINARY, 0)
if ret = 0 then msgbox "upload failed"
InternetCloseHandle server
InternetCloseHandle session
change the 5 variables to suit and try it
Re: Setting FTP upload as "passive"