BASE64-DECODE error

Vijeth79

New Member
Hi need help on BASE64-DECODE:

getting an error of "Error converting Base64 to RAW (12119)"

I'm not using any RAW variable but still getting an error.
Progress version : 11.6
Service pack : 03
OS and version : Windows Server 2012 R2


Code:
    METHOD PUBLIC CHARACTER Base64ToTempDir(ip-base64string AS LONGCHAR,
                                            ip-extension AS CHARACTER,
                                            ip-usetempuploaddir AS LOGICAL,
                                            ip-filenamemode AS INTEGER):
    DEFINE VARIABLE lv-filepath   AS CHARACTER NO-UNDO.
    DEFINE VARIABLE lv-tempdir    AS CHARACTER NO-UNDO.
    DEFINE VARIABLE lv-decodemptr AS MEMPTR    NO-UNDO.
    DEFINE VARIABLE lv-len        AS INTEGER   NO-UNDO.
    DEFINE VARIABLE lv-error      AS CHARACTER NO-UNDO.
    DEFINE VARIABLE lv-errorNo    AS INTEGER   NO-UNDO.

        IF lv-tempdir = "" OR lv-tempdir = ? THEN
            ASSIGN lv-tempdir = SESSION:TEMP-DIRECTORY.
       
        ASSIGN
            lv-len = LENGTH(lv-tempdir).
       
        IF SUBSTRING(lv-tempdir,lv-len,1) NE "\" AND SUBSTRING(lv-tempdir,lv-len,1) NE "/" THEN
            ASSIGN lv-tempdir = lv-tempdir + "/". /* forward-slash for multi platform compatibility */
       
        IF ip-extension <> "" AND NOT ip-extension BEGINS "." THEN
            ASSIGN ip-extension = "." + ip-extension.
           
        SET-SIZE(lv-decodemptr)= 0.
                              
        ASSIGN  lv-filepath   = lv-tempdir + THIS-OBJECT:GenerateUniqueToken(ip-filenamemode) + ip-extension
                lv-decodemptr = BASE64-DECODE(ip-base64string).

            COPY-LOB FROM lv-decodemptr TO FILE lv-filepath.                    
            RETURN lv-filepath.   
       
        FINALLY:
            SET-SIZE(lv-decodemptr) = 0.
        END FINALLY.
       
    END METHOD.
 
Last edited by a moderator:

Cringer

ProgressTalk.com Moderator
Staff member
Please use a new thread for a new problem.
 

Cringer

ProgressTalk.com Moderator
Staff member
Also, it would help to have a working code snippet rather than pseudo code, and your Progress version might be pertinent too.
 
Top