[Progress Communities] [Progress OpenEdge ABL] Forum Post: Send/Receive file from appserver.

Status
Not open for further replies.
O

OctavioOlguin

Guest
I'm testing before making some programs, but I stumble upon on this. (Classic Appserver 11.5, client networking 11.7, both on windows) This is the client DEFINE VARIABLE hServer AS HANDLE NO-UNDO. DEFINE VARIABLE lRetOK AS LOGICAL NO-UNDO. def var mFile1 as memptr no-undo. def var mFile2 as memptr no-undo. //SET-SIZE(mFileCopy) = 700000. CREATE SERVER hServer. lRetOK = hServer:CONNECT("-H xxx.101.yyy.zzz -DirectConnect -S 9030 -AppService schAS1 -sessionModel Session-free") . IF NOT lRetOK THEN DO: MESSAGE ERROR-STATUS:GET-MESSAGE (1). RETURN. END. COPY-LOB FILE "d:\t\log.lg" TO OBJECT mFile1. run procs\tdi\test.p on hServer (INPUT mFile1, output mFile2). COPY-LOB OBJECT mFile2 to file "d:\t\t2.exe". hServer:DISCONNECT(). DELETE OBJECT hServer. CATCH myS AS Progress.Lang.SysError : MESSAGE myS:NumMessages myS:getmessage(1) VIEW-AS ALERT-BOX ERROR BUTTONS OK TITLE "SysError". END CATCH. CATCH myA AS Progress.Lang.AppError : MESSAGE myA:NumMessages myA:getmessage(1) VIEW-AS ALERT-BOX WARNING BUTTONS OK. END CATCH. FINALLY: SET-SIZE(mFile1) = 0. SET-SIZE(mFile2) = 0. END. This is the server process BLOCK-LEVEL ON ERROR UNDO, THROW. DEFINE INPUT PARAMETER mInput AS MEMPTR NO-UNDO. DEFINE OUTPUT PARAMETER mFile AS MEMPTR NO-UNDO. /* *************************** Main Block *************************** */ MESSAGE NOW "copy-lob". COPY-LOB OBJECT mInput TO FILE "C:\t\log1.txt". COPY-LOB FILE "c:\t\t2.exe" TO OBJECT mFile. FILE-INFO:FILE-NAME = "C:\t\log1.txt". MESSAGE NOW "txt tfile size: " FILE-INFO:FILE-SIZE. MESSAGE NOW "mFile size: " GET-SIZE(mFile). MESSAGE NOW "End copy-lob". CATCH myS AS Progress.Lang.SysError : RETURN ERROR NEW Progress.Lang.AppError(myS:GetMessage(1), 404). END CATCH. CATCH myA AS Progress.Lang.AppError : RETURN ERROR NEW Progress.Lang.AppError(myA:GetMessage(1), 404). END CATCH. FINALLY: set-size(mFile) = 0. set-size(mInput) = 0. END. The process runs accordingly... d:\t\log.lg file is textfile. On server side, I get the file on disk with content ok. On the client side, the resulting file t2.exe. is 0 bytes in length... Using notes from Copying a large File > 3 GB from Appserver to client - Forum - OpenEdge Development - Progress Community TIA Jorge

Continue reading...
 
Status
Not open for further replies.
Top