Well, I went a bit ahead and found out that there is probably a bug in the service.
the InternetConnect is always called by passing INTERNET_SERVICE_FTP as paramenter
this call in my situation gives me back no Handle but if I set it as INTERNET_SERVICE_HTTP then i can retrieve a valid handle
so I put a new property in the object called "nInternetService" and tried to manage.
actually I stop a bit later :(
IF PCOUNT()=0 OR EMPTY(m.lcCurrentFolder)
lcCurrentFolder = SPACE(MAX_PATH)
fResult = FtpGetCurrentDirectory(m.lnConnect_Handle, @m.lcCurrentFolder, MAX_PATH)
This.GetExtendedError()
ELSE
fResult = FtpSetCurrentDirectory(m.lnConnect_Handle, @m.lcCurrentFolder)
ENDIF
i can't understand why , because it works fine on my pc where I don't have proxy. I Try to find out and let you know
Thanks for your precious support :)
lnConnect_Handle = InternetConnect(This.nInet_Handle, (This.cIPAddress), VAL(This.cPort), ;
(This.cUserName), (This.cPassword), this.nInternetService , This.nFlags, 0)
liAccessType=INTERNET_OPEN_TYPE_PROXY
this.nInternetService = Iif(this.cProxyProtocol='http', INTERNET_SERVICE_HTTP ,INTERNET_SERVICE_FTP)
>And ErrorCode and ErrorMsg are?
>
>MartinaJ
>
>>thanks for your help.
>>I put some messages inside the ftp class and discovered that the problem is in the call at the proc "OpenFTPConnection" where i cannot get a Handle from the internetConnect.
>>I tried to retrieve the error but I can't :
>>
>> This.GetExtendedError()
>> IF lnConnect_Handle = 0
>> =MessageBox(Transform(this.GetExtendedErrorCode())+Chr(13)+Transform(this.GetExtendedErrorMsg()),0,"1")
>> RETURN .F.
>> ENDIF
>>
>>
>>
>>>What error you get after calling method OpenInternet()?
>>>?this.Ftp.GetExtendedErrorCode(),this.Ftp.GetExtendedErrorMsg()
>>>
>>>MartinaJ
>>>
>>>
>>>>here is lines of code :
>>>>
>>>>If !(Type("this.ftp") == 'O' and !IsNull(this.ftp))
>>>> this.Ftp = createobject('ftp_service')
>>>> this.ftp.cProxyPort = zProxyPort
>>>> this.ftp.cProxyHost = zProxyIp
>>>> If !Empty(zProxyip)
>>>> this.ftp.cProxyProtocol = zProxyProtocol
>>>> Else
>>>> this.ftp.cproxyProtocol = ''
>>>> EndIf
>>>>EndIf
>>>>
>>>>this.statoConn = this.Ftp.OpenInternet(zUserFtp, zPwFtp, zFtpAddress, zFtpPort)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>How you set cProxy???? properties on FTP object?
>>>>>
>>>>>MartinaJ
>>>>>
>>>>>
>>>>>>I tried but without success :(
>>>>>>
>>>>>>I installed a filezilla ftp client on that pc and it works with these settings :
>>>>>>
>>>>>>proxy FTP = none
>>>>>>
>>>>>>Generic Proxy : connection method = http/1.1
>>>>>> host proxy = 10.4.50.10
>>>>>> proxy port = 3128
>>>>>>
>>>>>>What should I do to make my program working ?
>>>>>>
>>>>>>thanks again
>>>>>>
>>>>>>
>>>>>>>Hi Alessio,
>>>>>>>
>>>>>>>Check cProxyProtocol property in help...
>>>>>>>
>>>>>>>MartinaJ
>>>>>>>
>>>>>>>>Hi Michel, sorry for disturbing you, but I don't know what to do for connecting to a ftp server from a under proxy client.
>>>>>>>>
>>>>>>>>I'm using the Robert Abram ftp service V.2.0.9 and it works fine without proxy but I don't know what to do for bypassing the proxy
>>>>>>>>
>>>>>>>>actually I call the openinternet function in this way
>>>>>>>>
>>>>>>>>
>>>>>>>> this.Ftp = createobject('ftp_service')
>>>>>>>> this.ftp.cProxyPort = zProxyPort
>>>>>>>> this.ftp.cProxyHost = zProxyIp
>>>>>>>>
>>>>>>>> this.connStatus = this.Ftp.OpenInternet(zUserFtp, zPwFtp, zFtpAddress, zFtpPort)
>>>>>>>>
>>>>>>>>
>>>>>>>>well, i can't connect
>>>>>>>>
>>>>>>>>what should I do to make it working ?
>>>>>>>>
>>>>>>>>Thank you so much
>>>>>>>>Alessio