FWPPC and FTP

Post Reply
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

FWPPC and FTP

Post by Maurizio »

Hello
I use the function FTP of Enrico
http://67.222.39.232/forums/viewtopic.p ... hlight=ftp
it works well , but dont open the GPR connection .

I add the function GPRSCONNECT and GPRSRELEASE
http://67.222.39.232/forums/viewtopic.p ... prsconnect

They work bat at the line of the FTP function
hCon = INTERNETCONNECT( hInternet, "ip_do_Site_ftp",0, "Usuário","senha", INTERNET_SERVICE_FTP, 0,0 )

hCon return zero .

It is possible use FTP and open automatic the connection ?

Thank in advance

Maurizio
User avatar
Biel EA6DD
Posts: 680
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca
Contact:

Post by Biel EA6DD »

Hi Maurizio
I'm using the same functions like you, and are running ok.

Code: Select all

hGprs:=GprsConnect()
hInternet:= InternetOpen( "HnasMbl", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )
IF !hInternet==0
   WHILE hConnect==0 .AND. nTrys<=3
      hConnect:=InternetConnect( hInternet, Trim(Cfg->Ip), Cfg->Puerto, Trim(Cfg->Usr), Trim(Cfg->Psw), INTERNET_SERVICE_FTP, 0, 0 )
      nTrys++
...
Here you have a sample how I'm using the functions to connect to the FTP server via GPRS.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Ciao Maurizio, hello Biel,

open the GPR connection
this means you have a smartphone.

As I don’t have had a smartphone ever (I am waiting for the HTC diamond – it should arrive the next days) I would be interested how
quick a connection is established.
Maurizio do you think - what I would like to do – you could use FTP to transfer the orders a waiter in a restaurant collects?
Thanks in advance
Otto
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Hello Biel

Thank but I have the same problem

Hello Otto , guten morgen

I use FTP for transfer selling order

For transfer the orders a waiter in a restaurant collects I use TSocket
( by wireless ) and it works well .
MAurizio
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: FWPPC and FTP

Post by Richard Chidiak »

Maurizio,

This is the code i use with success (including with gprs connection)

Code: Select all

hInternet := InternetOpen( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )  // pocket connexion gprs
IF hINTERNET = 0
   MSGINFO("ERREUR CONNEXION INTERNET envoi sortant")
   RETURN .F.
ENDIF

hCon1 = INTERNETCONNECT( hInternet, DSITE,INTERNET_INVALID_PORT_NUMBER, DUSER, DPASS, INTERNET_SERVICE_FTP, 0,0 )
IF HCON1 = 0
   MSGINFO("ERREUR Création CONNEXION FTP envoi sortant ... Abandon transmission ")
   RETURN .F.
ENDIF


HTH 

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: FWPPC and FTP

Post by Richard Chidiak »

Forgot to join the defines

here they are below

Code: Select all


#define FILE_ATTRIBUTE_READONLY  1
#define FILE_ATTRIBUTE_HIDDEN    2
#define FILE_ATTRIBUTE_SYSTEM    4
#define FILE_ATTRIBUTE_DIRECTORY 16
#define FILE_ATTRIBUTE_ARCHIVE   32
#define FILE_ATTRIBUTE_NORMAL    128
#define FILE_ATTRIBUTE_TEMPORARY 256

//
// access types for InternetOpen()
//

#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


//
// manifests
//

#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.


//
// service types for InternetConnect()
//

#define INTERNET_SERVICE_FTP     1
#define INTERNET_SERVICE_GOPHER  2
#define INTERNET_SERVICE_HTTP    3


//
// flags for FTP
//

#define INTERNET_FLAG_TRANSFER_ASCII  1
#define INTERNET_FLAG_TRANSFER_BINARY 2

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Does FTP work with Windows mobile 6.1 professional?

Does someone have an exe file to test?

Thanks in advance
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

Have you located an image for the emulator for such Windows Mobile version ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Post by Maurizio »

Ciao Otto

I use FTP with Windows mobile 6.

Maurizio
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello Maurizio,

Thank you for your answer.
May I send you my code maybe you see where I have made a mistake.
Regards,
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

I have answered you by email. It seems to me as there is a missing "/" in your code.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Antonio,
thank you very, very much.
It was not the \ but a much more foolish mistake. Without your hint I think I wouldn’t have found it.
I checked if the file is there: Here was all ok. But then I inserted /test/ again.
Now the upload is working.

Regards,
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

glad to know you solved it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply