ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Bonjour, j'ai un problème lors de l’exécution le transfert s'effectue mais au niveau de mon serveur y'a rien qui s'affiche pouvez vous m'aider maerc   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

ven. 29 mai 2015, 14h57
taherkefi
Canada Canada

atoutfox.public.association

Bonjour, j'ai un problème lors de l’exécution le transfert s'effectue mais au niveau de mon serveur y'a rien qui s'affiche pouvez vous m'aider maerc

**********************************************************************************
*... FTPPut.PRG ...*

PARAMETERS lcHost, lcUser, lcPassword, lcSource, lcTarget, lnXFerType

*.................................................................................
*: Usage: DO ftpput WITH ;
*: 'ftp.host', 'name', 'password', 'source.file', 'target.file'[, 1 | 2]
*:
*: Where: lcHost = Host computer IP address or name
*: lcUser = user name - anonymous may be used
*: lcPassword = password
*: lcSource = source file name (remote)
*: lcTarget = target file name (local)
*: lnXFerType = 1 (default) for ascii, 2 for binary
*.................................................................................

DECLARE INTEGER InternetOpen IN wininet.DLL;
STRING sAgent,;
INTEGER lAccessType,;
STRING sProxyName,;
STRING sProxyBypass,;
STRING lFlags

DECLARE INTEGER InternetCloseHandle IN wininet.DLL INTEGER hInet

DECLARE INTEGER InternetConnect IN wininet.DLL;
INTEGER hInternetSession,;
STRING lcHost,;
INTEGER nServerPort,;
STRING lcUser,;
STRING lcPassword,;
INTEGER lService,;
INTEGER lFlags,;
INTEGER lContext

DECLARE INTEGER FtpPutFile IN wininet.DLL;
INTEGER hConnect,;
STRING lpszLocalFile,;
STRING lpszNewRemoteFile,;
INTEGER dwFlags,;
INTEGER dwContext

PUBLIC hOpen, hftpSession

lcHost = ALLTRIM(lcHost)
lcUser = ALLTRIM(lcUser)
lcPassword = ALLTRIM(lcPassword)
lcSource = ALLTRIM(lcSource)
lcTarget = ALLTRIM(lcTarget)

IF connect2ftp (lcHost, lcUser, lcPassword)
WAIT WINDOW 'Transferring....' NOWAIT
IF FtpPutFile(hftpSession, lcSource,;
lcTarget, lnXFerType, 0) = 1
WAIT WINDOW lcSource + ' transferred.' TIMEOUT 2
ENDIF

= InternetCloseHandle (hftpSession)
= InternetCloseHandle (hOpen)
ENDIF

*..................... connect2ftp .........................................
*... Makes sure there is actually a valid connection to the host
FUNCTION connect2ftp (lcHost, lcUser, lcPassword)
* open access to Inet functions
hOpen = InternetOpen ("vfp", 1, 0, 0, 0)

IF hOpen = 0
? "Unable to get access to WinInet.Dll"
RETURN .F.
ENDIF

*... The first '0' says use the default port, usually 21.
hftpSession = InternetConnect (hOpen, lcHost,;
6055, lcUser, lcPassword, 1, 0, 0) &&... 1 = ftp protocol

IF hftpSession = 0
* close access to Inet functions and exit
= InternetCloseHandle (hOpen)
? "ftp " + lcHost + " is not available"
RETURN .F.
ELSE
? "Connected to " + lcHost
ENDIF
RETURN .T.
RETURN

Permalink : http://www.atoutfox.org/nntp.asp?ID=0000016392
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3