PARAMETERS cFileName


SET TALK off
SET STATUS BAR OFF
SET SYSMENU off
SET DELETED on
SET CONFIRM OFF
SET NOTIFY off
SET SAFETY off
SET CENTURY ON
SET DATE TO DMY
SET FIXED OFF
SET DECIMALS TO 6


*** Clases para el manejo de Web
SET PATH TO ".\classes" ADDITIVE
SET PROCEDURE TO wwHTTP ADDITIVE   
SET PROCEDURE TO wwAPI ADDITIVE
SET PROCEDURE TO wwFTP ADDITIVE
SET PROCEDURE TO wwUtils ADDITIVE
SET PROCEDURE TO classes\wwEval ADDITIVE

PUBLIC oHTTP, oIP

oIP = CREATEOBJECT("wwFTP")

ftpsend(cFileName+'.7z',cFileName)


FUNCTION ftpsend(cFileDes, cFileOri)
	

	WAIT WINDOW 'Enviando '+cFileDes NOWAIT 
	
	cZipFileName = cFileDes
	cTxtFileName = cFileOri


	cmdZip =  '7z a -mx=9 '+cZipFileName+' '+cTxtFileName
	RUN &cmdZip
	lRetVal = .T.

	IF oIp.FTPSendFile ("ftp.tecsicom.net",;
	            cZipFileName,;
	            cZipFileName,;
	            "data@tecsicom.net",;
	            "tecsicom2012")=0
	            
	ELSE
		lRetVal = .f.
		MESSAGEBOX('Error ftp: '+oIp.cErrorMsg,63,'FTP Error')
	ENDIF

	
	WAIT WINDOW 'Listo' TIMEOUT 1

	RETURN lRetVal 

ENDFUNC


