|
-
Dec 10th, 2009, 09:32 PM
#1
Thread Starter
Member
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
Last edited by Endorphine; Dec 10th, 2009 at 10:10 PM.
-
Dec 10th, 2009, 10:52 PM
#2
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)
-
Dec 10th, 2009, 10:55 PM
#3
Thread Starter
Member
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.
-
Dec 11th, 2009, 12:03 AM
#4
Thread Starter
Member
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.
-
Dec 11th, 2009, 05:22 AM
#5
Re: Setting FTP upload as "passive"
try searching the forum there have been many examples posted
i remember posting an example using passive
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 11th, 2009, 11:27 AM
#6
Thread Starter
Member
Re: Setting FTP upload as "passive"
I've already done that.
I'm just not understanding it I guess.
-
Dec 11th, 2009, 03:13 PM
#7
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
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 11th, 2009, 03:23 PM
#8
Thread Starter
Member
Re: Setting FTP upload as "passive"
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
|