Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FTP Service Class
Message
 
 
To
04/04/2002 13:28:17
Mike Smith
Doncaster Office Services
Oakville, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00640200
Message ID:
00641016
Views:
91
>Nadia:
>
>I am still stuck on first base.
>
>The code below generates the error "No Connection Made".
>
>First I log onto my ISP so there is a conenction to the internet. I have also browsed to the site "ftp://doncasteroffice.net/rentmast/update/" to see the files there.
>
>But when I run the code below, I get no connection. I have also tried to make a connection with this code to "ftp://west-wind.com/updates" which is an anonomyous site but again I get the "No Connection" error.
>
>I am using IE Ver 5.5. I have tried the code under Win 98 and Win NT 4.0 without success.
>
>Have you got some sample code that would connect me to an anonymous site so I can check for punctuation etc.?
>
>Thanks.
>
>Mike Smith
>**************

See changes inside your code:
>
>lparameter cUserId,cPassword,cFtpAddr,cTheFile,cFtpFile,cFtpPath, tlSilentMode
>if vartype(m.sz_ftp)#'O'
>	sz_ftp = newobject('ftp_service',"ftp.prg")
>endif
>
>local lcReturn, lcSetSafety, s
>lcReturn=".T."
>
>lcSetSafety = set('safety')
>set safety off
>FtpPath = "/rentmast/update/"
>cUserId = "michaels"
>cPassword = "michaels123"
>cFtpAddr = "www.doncasteroffice.net"
>
>if sz_ftp.OpenInternet(m.cUserId,m.cPassword, m.cFtpAddr, "21")
>	if !empty(m.cFtpPath)
>		if !sz_ftp.ChangeFtpDirectory(m.cFtpPath)
>			s=sz_ftp.GetErrorCode(.t.)
>			lcReturn=".F.Can not change directory"  && Set to false if - Will use this as a check as to whether
>		endif
>	endif
>	cFtpFile = "testfile.txt"
>	cTheFile = "C:\TEMPRENT\TESTFILE.txt"
>	if m.lcReturn =".T."
>		if !sz_ftp.PutFtpFile(m.cFtpFile, m.cTheFile)
>			lcReturn=".F.Can not put file "+ m.cFtpFile+" on the FTP Site"
>		else
>			lcReturn = ".T."
>		endif
>	endif
>	sz_ftp.CloseInternet()
>else
>	if not m.tlSilentMode
>		=messagebox("No Connection Made", 64, "FTP Message")
>	endif
>	sz_ftp.CloseInternet()
>	lcReturn=".F.No Connection Made"
>endif
>
>release sz_ftp
>return m.lcReturn
I've tried this code (with my files) and I was able to connect, but this is the error, I got, then tried to put file from d:\My Documents\

200 Type set to I.
200 PORT command successful.
550 Aforisms.doc: Access is denied.

I was able to put the file successfully using WS Ftp Pro program.

We use addresses either as IP or like www.somesite.com

BTW, you better change your login and password soon, if you don't want hackers on your site.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform