Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FTP from a form - trying to use Robert Abram's FTP class...

80 views
Skip to first unread message

Duffy W.

unread,
Feb 28, 2005, 7:58:48 PM2/28/05
to
Hi everyone! Got a bit of a sticky little error that I can't track down.
I can't get connected to an FTP server, nor can I get any meaningful error
data no matter how hard I try to trap it.

I'm basically trying to query an FTP server, pull down a particular file,
do a quick filetostr(), make some changes, strtofile(), and then back up to
the FTP server. Sound simple, but it's driving me nuts.

I'm using Robert Abram's FTP class and my code is as follows:


Set Procedure To ftp.prg Additive


*** define user/pass for FTP (It all comes back correctly)

ftpusername = ALLTRIM(accountdata.username) &&char
ftppass = ALLTRIM(accountdata.pass) &&char
ftpdomainaddresse = ALLTRIM(accountdata.url) &&char
ftpport = 21 &&numeric

*** Connect to FTP
obj_download_ftp = createobject('ftp_service')

lconnected = obj_download_ftp.OpenInternet(ftpusername, ftppass,
ftpdomainaddresse, ftpport)


***gimme an error.... any error.
? "openinternet has returned: "
? lconnected
? "error code: "
obj_download_ftp.GetExtendedErrorCode()
? obj_download_ftp.GetExtendedErrorCode()


MESSAGEBOX(obj_download_ftp.GetExtendedErrorCode(), 48,
"error?...")

IF lconnected = .T.
&&connected!
ELSE
MESSAGEBOX("Oh No! Couldn't connect ot FTP server.",48,"FTP
Server took a dive.")
ENDIF

If you'll forgive my rather frivolous comments, and look past the many ?
lines (there were a lot more attempts at getting some form of feedback, but
I've eiter abandoned those or left them out of the example code), perhaps
one of you fine people will spot what I'm doing wrong, but it sure isn't
connecting to the FTP server. I keep TCPView open to see if it's even
trying, and it doesn't even register a blip. i've even copied wininet.dll
to the exe file's directory in an effort to make sure that it's finding
everything it says it needs.

Cheers!

-Duffy





Dan Freeman

unread,
Mar 1, 2005, 12:00:49 PM3/1/05
to
> *** Connect to FTP
> obj_download_ftp = createobject('ftp_service')
> lconnected = obj_download_ftp.OpenInternet(ftpusername, ftppass,
> ftpdomainaddresse, ftpport)

I'm not familiar with that class, but they're all pretty much the same:
wrappers around WinInet API calls.

Standard troubleshooting applies. Can you connect to that FTP server using a
stand-alone FTP client and the same credentials your code is using? How
about the command line FTP utility? Do you have a firewall or proxy server
getting in the way?

Dan

Duffy W.

unread,
Mar 1, 2005, 4:26:25 PM3/1/05
to
Dan:
Yep, it's a fairly stable FTP server, and I made sure that it was easily
accessible by other FTP programs.

I wonder if I shouldn't just try to call the wininet.dll myself, although,
that might be a pain, it might be a little bit better not having to go
through a wrapper. But oh, what a pain. heh.


"Dan Freeman" <sp...@microsoft.com> wrote in news:#C5p5AoHFHA.3040
@TK2MSFTNGP10.phx.gbl:

Eric den Doop

unread,
Mar 2, 2005, 5:31:46 AM3/2/05
to
Hello, Duffy!

Try changing active / passive ftp mode in IE options.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8


Liska Station

unread,
Mar 2, 2005, 11:54:19 AM3/2/05
to
Hiya Eric!
No go, it still isn't working.
Any suggestions on poerhaps a good OCX, activeX, or DLL file that's easy to
work wih for FTP? If not, it looks like I'm going to have to write my own.
Joy. On the up-shot, it might not take quite as long as fiddling with this
.PRG heheh.

Rick Bean

unread,
Mar 2, 2005, 2:06:50 PM3/2/05
to
You can check Rick Strahl's out for free and the cost is pretty small - http://www.west-wind.com/wwipstuff.asp.

Rick

"Liska Station" <msnewsJU...@DuffyWeber.com> wrote in message news:Xns960D78C8A9A...@207.46.248.16...

Duffy W.

unread,
Mar 3, 2005, 5:28:12 PM3/3/05
to
Thanks! I'll give it a whirl!

-Duffy


"Rick Bean" <rgb...@unrealmelange-inc.com> wrote in news:uxnz$r1HFHA.896
@TK2MSFTNGP10.phx.gbl:

davidm...@gmail.com

unread,
Jul 6, 2013, 2:58:58 PM7/6/13
to
Hi, 8 years after I'm sure you on to something else, but I am posting this for anyone else having problem with this class which - was last updated by Martina Jindrova and - I am using it ok. I think the above problem is simply due to the fact that the port number was passed as numeric instead of character.

David
0 new messages