Hi All
I have an application running on a Samsung Omnia Mobile phone running windows 6 - I am trying to setup FTP
from the phone back to a windows server - using the sample code by Enrico but I cant get hConnect to return a value
hConnect = INTERNETCONNECT( hInternet, "myIP",INTERNET_DEFAULT_FTP_PORT, "myUser", "myPass", INTERNET_SERVICE_FTP,0, 0 )
In a desktop app - I use the tip library to connect back to the same server and have no problems
#include "tip.ch"
function send()
local cServer := '',cUser := '',cPassword := '',oUrl,oFtp,cFile := 'error.log'
cServer := myIP
cUser := myUser
cPassword := myPass
cUrl := "ftp://" + cUser + ":" + cPassword + "@" + cServer
oUrl := tUrl():New(cUrl)
oFtp := tIPClientFtp():New(oUrl,.t.)
oFtp:nConnTimeout := 20000
oFtp:bUsePasv := .t.
oFtp:lTrace := .f.
if oFtp:open(cUrl)
if oFtp:UpLoadFile((cFile))
oFtp:close()
endif
else
?? 'Error openning url'
wait
endif
return(nil)
Thanks for any ideas.
Colin
FTP
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Re: FTP
Colin
I am not sure tip class is compatible with fwppc, this is a sample of using ftp with fwppc (works with my app since long time)
HTH
Richard
I am not sure tip class is compatible with fwppc, this is a sample of using ftp with fwppc (works with my app since long time)
HTH
Richard
Code: Select all
#define INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration
#define INTERNET_OPEN_TYPE_DIRECT 1 // direct to net
#define INTERNET_OPEN_TYPE_PROXY 3 // via named proxy
#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4 // prevent using java/script/INS
#define INTERNET_INVALID_PORT_NUMBER 0 // use the protocol-specific default
#define INTERNET_DEFAULT_FTP_PORT 21 // default for FTP servers
#define INTERNET_DEFAULT_GOPHER_PORT 70 // " " gopher "
#define INTERNET_DEFAULT_HTTP_PORT 80 // " " HTTP "
#define INTERNET_DEFAULT_HTTPS_PORT 443 // " " HTTPS "
#define INTERNET_DEFAULT_SOCKS_PORT 1080 // default for SOCKS firewall servers.
#define INTERNET_SERVICE_FTP 1
#define INTERNET_SERVICE_GOPHER 2
#define INTERNET_SERVICE_HTTP 3
#define INTERNET_FLAG_TRANSFER_ASCII 1
#define INTERNET_FLAG_TRANSFER_BINARY 2
Internet := InternetOpen( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )
IF hINTERNET = 0
MSGINFO("ERROR ON CONNEXION")
RETURN .F.
ENDIF
hCon1 = INTERNETCONNECT( hInternet, MYSITE,INTERNET_INVALID_PORT_NUMBER, MYUSER, MYPASS, INTERNET_SERVICE_FTP, 0,0 )
IF HCON1 = 0
MSGINFO("ERREUR ON CONNEXION FTP ")
RETURN .F.
ENDIF
// RETREIVE THE FILES HERE
INTERNETCLOSEHANDLE( hCon1 )
INTERNETCLOSEHANDLE( hInternet )
-
- Posts: 310
- Joined: Mon Oct 10, 2005 5:10 am
Re: FTP
Hi Richard
Thanks for your sample code - I still cant get the HCON1 to work - I get a
hInternet value - is there any other settings on the phone I should look at ,
I have the browser set to WAP and have tested I can get a website on the phone.
Regards
Colin
Thanks for your sample code - I still cant get the HCON1 to work - I get a
hInternet value - is there any other settings on the phone I should look at ,
I have the browser set to WAP and have tested I can get a website on the phone.
Regards
Colin
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: FTP
Colin,
Are you able to access the web from your emulator or your phone ?
have you tried to access ftp.microsoft.com for reading ?
Are you able to access the web from your emulator or your phone ?
have you tried to access ftp.microsoft.com for reading ?