FTP Uplaod ERROR

FTP Uplaod ERROR

Postby rasptty » Tue Sep 09, 2008 10:55 pm

Boas estou a utilizar a classe FTP.
sempre que faço a 1º vez um download , está OK funciona bem...

a segunda vez o mesmo nome de ficheiro mas com dados diferentes
aparece sempre o 1º


A classe não dá qualquer ERRO, será que tenho que fazer um refresh, clear memory ou sei lá...
Ajudem.me OBRIGADO
rasptty
 
Posts: 88
Joined: Sun May 25, 2008 5:46 pm

Postby Antonio Linares » Sun Sep 21, 2008 10:17 am

Por favor muestra el PRG que estás usando para que lo probemos, gracias

Please show us the PRG code that you are using so we can test it, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41898
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby rasptty » Sun Sep 21, 2008 12:04 pm

** FUNÇÕES DE FTP *********************************************************************************

FUNCTION ftpver(regis)
LOCAL hInternet, hConnect, r, okk, hGprs, ligaok, kk, counter
Local msg_login:=""
Local msg_passs:=""

//
// File attributes
//

#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

do case
case regis=0

CursorWait()
*/ Sincroniza com o servidor FTP
*/ Para retirar informação

hInternet = INTERNETOPEN( "Anystring", INTERNET_OPEN_TYPE_DIRECT, 0, 0, 0 )


IF hINTERNET = 0
CursorWE()
MSGINFO("Não Existe Ligação á Net)
Return .f.
else

hConnect = INTERNETCONNECT( hInternet, my_host, INTERNET_INVALID_PORT_NUMBER, my_user, my_pass, INTERNET_SERVICE_FTP, 0, 0 )

IF hConnect = 0

hGprs:=GPRSCONNECTION()

if hGprs=.f.
CursorWE()
MSGINFO("Não Foi Possível Conectar o Servidor Erro 02..",sergio)
return .f.
else
hConnect = INTERNETCONNECT( hInternet, my_host, INTERNET_INVALID_PORT_NUMBER, my_user, my_pass, INTERNET_SERVICE_FTP, 0, 0 )

IF hConnect=0

GPRSRELEASE(hGprs)
CursorWE()
MSGINFO("Não Foi Possível Conectar o Servidor Erro 03..",sergio)
return .f.
else
ligaok=.t.
endif

endif
else
ligaok=.t.
endif

if ligaok=.t.
auxx_file_ph=CurDir()+"\data\pharma.ser"
r=FTPGETFILE( hConnect, "httpdocs/pharma/regista/pharma2.ser", auxx_file_ph, 0, FILE_ATTRIBUTE_ARCHIVE, 0, 0 )
endif

if hGprs=.t.
GPRSRELEASE(hGprs)
endif
CursorWE()

endif


case regis=1
** Outra Operação

case regis=2
** Outra Operação
endcase

RETURN NIL

/*Nota a rotina não dá qualquer erro está funcionar bem, quando faço download a 1º vez, o que se passa é na 2º Vez o Mesmo ficheiro mas com informação diferente, mesmo apagando o ficheiro no PDA ele aparece com a informação do 1º Dá a impressão que fica em memoria, só consigo evitar isso, quando mudo o nome do ficheiro a sacar do servidor.
*/
rasptty
 
Posts: 88
Joined: Sun May 25, 2008 5:46 pm


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 9 guests