tags:

views:

190

answers:

3

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

A: 

Use raw datatype, you might need to send the file in chunks. Another alternative is to use character+BASE64.

Totophil
+1  A: 
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 ).
Gordon Robertson
+1  A: 

This 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 streamed in segments. With OpenEdge (might have been 10.1B) we got CLOB and BLOB support, you can create a procedure which takes a temp-table as an argument.

It also depends on how you are calling language. For .NET and Java this will get translated into a byte array.

For your app-server 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.Code + 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 now call this from .NET and Java using a simple byte array as an input temp-table data-type.

Brett Ryan