Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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