Last active
June 2, 2019 16:34
-
-
Save danielAlbuquerque/0342fac7241b67278552ebc173bfe7b2 to your computer and use it in GitHub Desktop.
Upload de arquivo para o protheus_data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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