Skip to content

Instantly share code, notes, and snippets.

@danielAlbuquerque
Last active June 2, 2019 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielAlbuquerque/0342fac7241b67278552ebc173bfe7b2 to your computer and use it in GitHub Desktop.
Save danielAlbuquerque/0342fac7241b67278552ebc173bfe7b2 to your computer and use it in GitHub Desktop.
Upload de arquivo para o protheus_data
#include 'totvs.ch'
User Function zUpload(cUploadDir)
Local cArq := cGetFile('Arquivo *|*.*','Todos os Drives',0,'C:\Dir\',.T.,GETF_LOCALHARD,.T.)
Default cUploadDir := "\uploads\"
If !Empty( cArq )
If !ExistDir( cUploadDir ); MakeDir( cUploadDir ); EndIf;
If CpyT2S(cArq, cUploadDir)
Aviso("Upload de arquivo", "Arquivo enviado com sucesso", {"OK"}, 1)
Else
MsgStop("Não foi possível copiar o arquivo para o servidor")
Endif
Endif
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment