IMPORT security GLOBALS DEFINE codid INT, archivo VARCHAR(200), recibido string END GLOBALS MAIN CONNECT TO "smarmotech" USER 'jsoto' USING 'lmmjvsd2014' CALL proceso() END MAIN FUNCTION proceso() DECLARE busca CURSOR FOR SELECT a.codid,a.foto_producto FROM iptb00002 a WHERE a.foto_producto IS NOT NULL AND a.status_t IS NULL FOREACH busca INTO codid,archivo END FOREACH END FUNCTION FUNCTION b64_to_file(str_b64,f_sal) DEFINE f_sal,str_b64,str_aux STRING TRY CALL security.Base64.SaveBinary(f_sal,str_b64) CATCH LET str_aux="Unable to convert Base64 String to file :",STATUS CALL fgl_winmessage("Error",str_aux,"stop") END TRY END FUNCTION