Sending a file to another system

mmniet

New Member
Hello,

I face the following problem:
We have 2 systems. On one system there is a userinterface. User can create PDF-files. The pdf-files are created on system1.

The pdf-files have to send to system 2. I tried the following to read the pdf file:

INPUT STREAM abc FROM VALUE(cFile).
REPEAT:
IMPORT STREAM abc UNFORMATTED cText.
CASE icontent:
WHEN 1 THEN DO:
IF LENGTH(ttPdf.content1 + cText,"CHARACTER") LT 31000 THEN
ASSIGN ttPdf.content1 = ttPdf.content1 + cText.
ELSE
ASSIGN
ttPdf.content2 = cText
iContent = 2
.
END.
WHEN 2 THEN DO:
IF LENGTH(ttPdf.content2 + cText,"CHARACTER") LT 31000 THEN
ASSIGN ttPdf.content2 = ttPdf.content2 + cText.
ELSE
ASSIGN
ttPdf.content3 = cText
icontent = 3
.
END.
WHEN 3 THEN DO:
IF LENGTH(ttPdf.content3 + cText,"CHARACTER") LT 31000 THEN
ASSIGN ttPdf.content3 = ttPdf.content3 + cText.
ELSE
ASSIGN lOk = FALSE.
END.
END CASE.
END.
INPUT STREAM abc CLOSE.

I just the above method for xml-files behore, that worked fine. Now it doesnt work for PDF-files.

can anyone help me out on this?
 
if couldnt stop searching for an answer, so i have found one!

on system1:
INPUT FROM VALUE(cFile) BINARY NO-MAP NO-CONVERT.

/* check for file size */
/* SEEK INPUT TO END. */
/* i_len = SEEK(INPUT). */
/* MESSAGE i_len */
/* VIEW-AS ALERT-BOX INFO BUTTONS OK. */
/* SEEK INPUT TO 0. */

ASSIGN LENGTH (ra_rawdata) = 30 * 1024.
REPEAT:
IMPORT UNFORMATTED ra_rawdata.
CREATE ttdigispdf.
ASSIGN ttdigispdf.rawinhoud = ra_rawdata
ttdigispdf.debnr = cdebnr
ttdigispdf.aantaanm = caantaanm.

RELEASE ttdigispdf.
END.
ASSIGN LENGTH (ra_rawdata) = 0. /* Deallocate memory */
INPUT CLOSE.


on system2:
OUTPUT STREAM abc TO VALUE(cDir + "/" + cFilename).
FOR EACH ttdigispdf:
PUT STREAM abc CONTROL ttdigispdf.rawinhoud.
END.
OUTPUT STREAM abc CLOSE.
 
Back
Top