How to send PDF file to AppServer progress?

I have a PDF file on the client and I want to send this PDF file to AppServer. How can I send this pdf to AppServer?

+2


source to share


3 answers


define temp-table ttFileList no-undo
    field file-id as integer
    field file-content as blob.

create ttFileList.
assign ttFileList.file-id = 1.

copy-lob from file("pdffilename") to ttFileList.file-content.

run DoSomethingWithAPDF on hAppServer
    ( input table ttFileList ).

      



+2


source


It depends on the version of progress you are using, if you are using v9 then you will need to use small chunks of raw data passed across segments. With OpenEdge (maybe 10.1B) we got CLOB and BLOB support, you can create a procedure that takes a temporary table as an argument.

It also depends on your calling language. For .NET and Java this will translate into a byte array.

For your server application, create a procedure similar to the following:



def temp-table ObjectTransfer no-undo
    field Code          as char
    field Number        as int
    field DataContent   as blob
    field MimeType      as char.

procedure AddObjectData:
    def input param table for ObjectTransfer.

    def var k as int no-undo.

    for each ObjectTransfer:
        find last ObjectTable no-lock
            where ObjectTable.Code = ObjectTransfer.Code
            no-error.
        if avail ObjectTable then
            k = ObjectTable.Number + 1.
        else
            k = 1.

        create ObjectTable.
        assign
            ObjectTable.Code = ObjectTransfer.Code
            ObjectTable.Number = k
            ObjectTable.MimeType = ObjectTransfer.MimeType
            ObjectTable.DataContent = ObjectTransfer.DataContent
            .
    end.
end procedure.

      

Generate proxies, you will call this from .NET and Java using a simple byte array as the input temp table datatype.

+2


source


To use a raw datatype, you may need to send the file in chunks. Another alternative is to use the + BASE64 character.

0


source







All Articles