Jump to content
Fivewin Brasil

mandar arquvio pdf para site


syspel

Recommended Posts

Amiguinhos,

function PutBackupOnFTPEXE( _file_ )
   //
   cPathINI             := "C:\SISTEMA"
   cSHLocalFolder       := cPathINI + "\PDFs"
   cSHFTPServerName     := VerifyINI( "BACKUPFTP", "SERVER" , "198.27.115.147"                , cPathINI+"nfw.ini", .f. ) // ftp.provedor.com.br
   cSHFTPServerPort     := VerifyINI( "BACKUPFTP", "PORTA"  , ""                              , cPathINI+"nfw.ini", .f. ) // ftp.provedor.com.br
   cSHFTPLoginID        := VerifyINI( "BACKUPFTP", "USUARIO", "desenvolvedor@5volution.com.br", cPathINI+"nfw.ini", .f. ) // usuario@provedor.com.br
   cSHFTPPassword       := VerifyINI( "BACKUPFTP", "SENHA"  , codifica("S3nh@S3gur@")         , cPathINI+"nfw.ini", .t. )
   cSHServerFolder      := VerifyINI( "BACKUPFTP", "CAMINHO", "backups"                       , cPathINI+"nfw.ini", .f. )
   errhandle := FCreate( "backup.ftp" )
   cSTRFile :=            "open " + cSHFTPServerName + iif(!empty(cSHFTPServerPort), cSHFTPServerPort, "" ) + CRLF
   cSTRFile := cSTRFile + cSHFTPLoginID + CRLF
   cSTRFile := cSTRFile + cSHFTPPassword + CRLF
   cSTRFile := cSTRFile + "cd " + cSHServerFolder + CRLF
   cSTRFile := cSTRFile + "hash" + CRLF
   cSTRFile := cSTRFile + "lcd " + cSHLocalFolder + CRLF
   cSTRFile := cSTRFile + "binary" + CRLF
   cSTRFile := cSTRFile + "put " + _file_ + CRLF
   cSTRFile := cSTRFile + "disconnect" + CRLF
   cSTRFile := cSTRFile + "bye" + CRLF
   cSTRFile := cSTRFile + "quit" + CRLF
   FWrite( errhandle, cSTRFile )
   FClose( errhandle )
   //
   MsgRun( "Aguarde o backup seguro na internet sendo realizado...", "Cloud-Backup", { || WinEXEC( "ftp -s:backup.ftp", 2 ) } )
   return nil

Use esta função que faz ponte para o FTP.EXE existente em qualquer versão do Windows e libere no seu provedor acesso externo para o seu IP se por segurança eles travaram e bom trabalho.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...