Problem with My Base64 Encoding CLOB  Routine.

I have written a program which reads an xml file into the database
and makes it Base64encoded.
This needs to work on 10g and above
If the read length specified in the code below is greater than the length of the xml_file, then I get the expected result(output).
However if the read length is less than the length of the file, then I get a lot of '==' in the file and as a result, incorrect encoding which means that the file will not be readable through the application.
I'm pretty sure I'm reading the blob lengths correctly, and the problem is somehow related to the base64 encoding.Any help appreciated
[create or replace profile_dir as &profile_dir;
create global temporary table load_xml
(profile_text clob)
on commit delete rows;
create or replace
procedure encode_xml_clobs(p_file_in  in varchar2,
                             p_clob_out out nocopy clob )
as
pragma autonomous_transaction;
    dest_clob   CLOB;
    src_clob    BFILE  := BFILENAME('PROFILE_DIR', p_file_in);
    dst_offset  number := 1 ;
    src_offset  number := 1 ;
    lang_ctx    number := DBMS_LOB.DEFAULT_LANG_CTX;
    warning     number;
-- processing declarations for encoding base64 --
v_xml_string varchar2(32767);
v_string varchar2(32767);
v_start_pos number := 0;
v_read_length number := 1000;
v_final_start_pos number;
v_clob_length number;
type clob_array_type is table of clob index by binary_integer;
clob_array clob_array_type;
v_index number :=0;
-- Declarations for converting base64encoded string to a clob
v_encoded_length number;
v_temp_clob clob;
BEGIN
    -- THE FOLLOWING BLOCK OF CODE WILL ATTEMPT TO INSERT / WRITE THE CONTENTS
    -- OF AN XML FILE TO A CLOB COLUMN. IN THIS CASE, WE WILL USE THE NEW
    -- DBMS_LOB.LoadCLOBFromFile() API WHICH *DOES* SUPPORT MULTI-BYTE
    -- CHARACTER SET DATA.
-- load_xml should be a  Global temporary table with on commit delete rows
    INSERT INTO load_xml(profile_text)
        VALUES( empty_clob())
        RETURNING profile_text INTO dest_clob;
    -- OPENING THE SOURCE BFILE IS MANDATORY
    DBMS_LOB.OPEN(src_clob, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.LoadCLOBFromFile(
          DEST_LOB     => dest_clob
        , SRC_BFILE    => src_clob
        , AMOUNT       => DBMS_LOB.GETLENGTH(src_clob)
        , DEST_OFFSET  => dst_offset
        , SRC_OFFSET   => src_offset
        , BFILE_CSID   => DBMS_LOB.DEFAULT_CSID
        , LANG_CONTEXT => lang_ctx
        , WARNING      => warning
    DBMS_LOB.CLOSE(src_clob);
--    DBMS_OUTPUT.PUT_LINE('Loaded XML File using DBMS_LOB.LoadCLOBFromFile: (ID=1');
-- file now successfully loaded
select dbms_lob.GETLENGTH(profile_text)
into v_clob_length
from load_xml;
-- File now loaded in temporary table
-- we now need to take the clob , convert it to varchar2
v_read_length :=64;
v_xml_string := '';
while v_start_pos <=  v_clob_length
loop
v_index := v_index + 1;
v_string := '';
--dbms_output.put_line('Start_pos=>'||(v_start_pos+1)||' Read Length=>'||v_read_length);
--encode base64
select utl_raw.cast_to_varchar2(
utl_encode.base64_encode(
utl_raw.cast_to_raw(dbms_lob.substr(profile_text,least(v_read_length,v_clob_length-v_start_pos),v_start_pos+1))
  into v_string
  from load_xml;
--dbms_output.put_line(v_string);
v_start_pos  := v_start_pos+v_read_length;
clob_array(v_index) := v_string;
end loop;
p_clob_out := clob_array(1);
for i in 2 .. v_index
loop
dbms_lob.append(p_clob_out,clob_array(i));
end loop;
commit;
END;

Base64 encoding encodes every 3 bytes of input data into 4 bytes of output data. It uses equal signs to indicate nodata and only at the end of the encoded sequence. Try chaning your v_read_length parameter to a multiple of 3 e.g. 960 or 1008 instead of the current 1000. I'm using multiples of 48 because the utl_encode.base64_encode function adds a linebreak for every 48 bytes of input data (64 bytes of output). If you use a value that's not divisible by 48 you will still get a legitimate encoding as long as it's divisible by 3, but you will get some lines longer than others when you append them together.

Similar Messages

  • Could not complete the Render Video command because of a problem with Adobe Media Encoder.

    So initially, my problem was solved, but it stopped working again.  Same issue.  I tried installing the media encoder app, but no luck please help!
    Here's the original post:
    Hello, I'm running a macbook pro retina, and previously I was able to render video with no issue, and now this is popping up.  I've tried deleting and reinstalling photoshop, but it was not helpful. I would very much appreciate any help or guidance.  Thanks!
    Here's the error message I get:
    Could not complete the Render Video command because of a problem with Adobe Media Encoder.
    Here's the original thread: Could not complete the Render Video command because of a problem with Adobe Media Encoder.

    Have you tried re-installing Photoshop?
    Benjamin

  • Are the problems with Compressor's encoding fixed yet?

    Sorry for the slightly vague title but I only use compressor once a year basically, which is after the production of a Christmas show I produce. Last year I upgraded ot Final Cut Studio to do the DVD and got caught out. I encoded using what I thought was the best setting (2 pass variable bit rate) and got jittery encoding. After investigating on this very forum, I found lots of comments about known problems with Compressor's encoding in this setting and ended up re encoding using one pass which was "ok".
    I'd rather do the best job I can so the basic question is, "is it fixed yet". Keeping in mind I understand about altering settings so that I can get the time I need onto one disc (110 minutes unfortunately!) What setting will offer me the best possible picture quality, regardless of encoding time, with compressor? Many, many thaks for any advice you regular user can offer!!
    Happy Christmas in advance, Gareth

    Gareth:
    According what was posted in this thread:
    http://discussions.apple.com/thread.jspa?threadID=760041&tstart=15
    by Brian a lot of problems must be solved using the last 2.3 version.
    Hope it helps !
      Alberto

  • Problem with windows media encoder

    Hello all,
     I am developing an application using labview which has to take the screen capture and should be able to save as *.avi or *.wmv.For that i am windows media encoder application from microsoft.I am using windows vista 64 bit OS.I am getting this error
    "E:\DashBoard_Production\wmcmd.vbs(378, 1) WScript.CreateObject: Could not create object named "WMEncEng.WMEncoder".
    Can anybody help me to solve this?
    Thanks and regards,
    srikrishnaNF

    hi, did you solve your problem?
    i have the same problem with python script i have made.
    lucas

  • Problem with Flash Media Encoder

    We're having problems trying to use Flash Media Encoder in
    conjunction with an Opsrey 230 card. The device shows up in the
    Encoding Options panel but when we try to change any settings we
    get the following error "Problem with video capture device. Please
    verify that it is working correctly and is not already in use"
    The card works fine with Windows Media Encoder. Viewcast
    support suggested trying it again with SimulStream enabled, but
    still no joy.
    Can anyone help?
    System - Windows XP Pro 2002 SP 2
    Thanks
    Phil

    Doesn't look like any of your capture cards are on the
    confirmed compatibility list... I wish there was a confirmed
    INcompatible list (add three from above).
    http://www.adobe.com/support/documentation/en/flashmediaencoder/FME_DeviceMatrix.pdf

  • Problems with importing .dmp file (CLOB)

    dear all
    i am using oracle 10g XE
    I am facing a problem with importing dmp ( one of my table contains clob coloum)
    below mentioned is the error it gives while importing, please guide me as to how to handle this.
    Thanks in advance
    regards
    Uday
    "CREATE TABLE "RTEXT" ("SRNO" NUMBER, "TEXTDET" CLOB) PCTFREE 10 PCTUSED 40"
    " INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS "
    "1 BUFFER_POOL DEFAULT) TABLESPACE "APEX_1244730274482010" LOGGING NOCOMPRES"
    "S LOB ("TEXTDET") STORE AS (TABLESPACE "APEX_1244730274482010" ENABLE STOR"
    "AGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE LOGGING STORAGE(INITIAL 65536 "
    "FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))"
    IMP-00003: ORACLE error 959 encountered
    ORA-00959: tablespace 'APEX_1244730274482010' does not exist

    You have to use SELECT tablespace_name, status FROM dba_tablespaces; from sql prompt or sql developer.
    Ash
    As Jonathan Lewis mentions:
    A general reminder about "Forum Etiquette / Reward Points": http://forums.oracle.com/forums/ann.jspa?annID=718
    If you never mark your questions as answered people will eventually decide that it's not worth trying to answer you because they will never know whether or not their answer has been of any use, or whether you even bothered to read it.
    It is also important to mark answers that you thought helpful - again it lets other people know that you appreciate their help, but it also acts as a pointer for other people when they are researching the same question, moreover it means that when you mark a bad or wrong answer as helpful someone may be prompted to tell you (and the rest of the forum) what's so bad or wrong about the answer you found helpful.

  • Please Help - Very strange problem with internal String encoding

    I created a file in one-byte russian encoding cp1251 and declared String literal with 2 letters:
    String str = "ab"; //attention! ab - two russian characters
    After I got bytes from it - str.getBytes("cp1251") - it returned 2 byte's array.
    Now I created a file with UTF-8 encoding with equal content and suddenly:
    After I got bytes from it - str.getBytes("cp1251") - it returned 4! byte's array. Why?
    I need to get a one-byte encoded arrays (cp1251 or koi8-r) but getBytes ALWAYS returns two-byte encoded arrays.
    It is very strange: cp1251 is always one-byte encoded, but .getBytes("cp1251") returns two-byte on each letter. Why? Please help.

    I did not read a string from a file. I created 2 .java files with different encodings (cp1251 and UTF-8) and compiled them, telling compiler with -Dfile.encoding=*** to read them correctly. While execution java interprets two looking equal in editor strings as different objects with different .intern() representation.
    Why java consider source .java file encoding while creating internal representation of String object and creates from looking equally in editor strings two DIFFERENT Unicode representations. And it is impossible to convert one representation to other - impossible to get two equal byte[] arrays.

  • Message Mapping Problem with UTF-16LE Encoded XML

    Hello,
    we have the following scenario:
    IDoc > BPM > HTTP Sync Call > BPM > IDoc
    Resonse message of the HTTP call is a XML file with UTF-16LE processing instruction. This response should then be mapped to a SYSTAT IDoc. However the message mapping fails "...XML Parser: No data allowed here ...".
    So obviously the XML is not considered as well-formed.
    When taking a look at SXMB_MONI the following message appears: "Switch from current encoding to specific encoding not supported.....".
    Strange thing however is if I save the response file as XML and use the same XML file in the test tab message mapping is executed successfully.
    I also tried to use a Java Mapping to switch encodings before executing message mapping, but the error remains.
    Could the problem be, that the codepage UTF-16LE is not installed on the PI system ? Any idea on that ?
    Thank you!
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM

    Hi,
    thank your for your answer.
    This is what I have tried to achieve. I apply the java conversion mapping when receiving the response message - i tried to convert the response to UTF-16, UTF-8 but none of them has helped to solve the problem.
    I guess that using adapter modules is not an option either as it would modify the request message, but not the response, right?

  • Problem with audio after encoding

    Hi,
    In my movie I added a couple of songs. When playing back the DVD I created with iDVD (using professional encoding), I realised the audio of the songs was very distorted or something. It didn't sound very clear or crisp. I had originally saved the project as a disc image, so, did I do something wrong? Or did this problem happen because of the encoding or something?
    Thanks.

    Hi
    How did the DiskImage play with Apple DVD-player ? OK ?
    Most probably one of two things has happened.
    a. I only use .aiff audio in my movies eg from miniDV tape video or from standard audio-CDs
    • mp3 or from iTunes = Problems
    • mp3 I convert to .aiff then import into iMovie
    • iTunes - I export out as an audio-CD with iTune pref set to export as .aiff
    then using this in my movie project
    (Strange formats of video material can also be trouble makers
    I only use streamingDV
    • .wav, avi, .mpg4 etc. I convert to this first)
    b. Low free space on the internal (boot) hard disk also gives strange results
    • Never under 25Gb free space when running iDVD is my goal
    Yours Bengt W

  • Problem with Adobe Media Encoder

    When I customize a H.264 preset and then save the preset for example as (1.00 Mbps bitrate) and then start the encoding, the defeault 3Mbps bitrate replaces any changes I made thus increasing the file size far beyond my desired file size. Is this a bug?
    Also, I have noticed when I select an output directory under the preferences, AME encodes the files to the source files directory instead of the directory I have designated.
    Anyone else experiencing these problems as well?

    Yes, also see this doc for more info: http://blogs.adobe.com/kevinmonahan/2014/02/12/prevent-crash-on-export-with-premiere-pro-c c-adobe-media-encoder-cc/
    Thanks,
    Kevin

  • JSP display problem with UTF-8 encoding

    Hi,
    I'm now writing JSP in order to input English, Traditional Chinese and Simplifed Chinese in the same form of the page. I've set the encoding as below:
    <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head>
    When, I get the user input in the next page, those Chinese become some squares, "?" or strange codes. However, when these data are store into database, and loaded from database, they display correctly in Chinese. That means I cannot get the string correctly directly from getParameter("") in next page.
    What can I do to fix this problem. Thank you so much!
    Zoe

    What is your environment (JDK, Server, DB)?
    Try add this line to the top of your next page to set the encoding character set. Otherwise, it will default to ISO-8859-1 which gives the chinese characters ??? when you try to display them.
    <%request.setCharacterEncoding("utf-8");%>
    Regards
    -WK-

  • Startup problem with adobe media encoder on mac

    adobe encore media does not start on Mac by this error:
    Process:         Adobe Media Encoder CS6 [553]
    Path:            /Applications/Adobe Media Encoder CS6/Adobe Media Encoder CS6.app/Contents/MacOS/Adobe Media Encoder CS6
    Identifier:      com.adobe.ame.application
    Version:         6.0.2 (6.0.2.81)
    Code Type:       X86-64 (Native)
    Parent Process:  launchd [142]
    Responsible:     Adobe Media Encoder CS6 [553]
    User ID:         501
    Date/Time:       2014-02-18 11:04:24.447 +0100
    OS Version:      Mac OS X 10.9.1 (13B42)
    Report Version:  11
    Anonymous UUID:  F6D50A8A-F4DF-3614-6A0B-CE4C30343769
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Application Specific Information:
    terminating with uncaught exception of type dvacore::filesupport::dir_create_exception: $$$/dvacore/filesupport/DirCreate=The directory '@0' could not be created. Please check the parent directory protection or permission rights.
    abort() called

    Yes, also see this doc for more info: http://blogs.adobe.com/kevinmonahan/2014/02/12/prevent-crash-on-export-with-premiere-pro-c c-adobe-media-encoder-cc/
    Thanks,
    Kevin

  • Problem with cs4 media encoder

    When I try and export media and use Microsoft avi i get a problem.
    At first it would give me pop up dialog box that said scratch files are only readable and it would place them in My documents.  You can only check yes or it will not let me go further.
    Then the program sayss that premier has encounter a problem and shuts down.
    I'm not sure what's happening.
    I did visit with someone that says if I had the trial version ,( which I did), and the when I bought the hard copy just installed with the new number, that I might try uninstalling the trial version and reinstalling.
    Please help.
    Thanks.

    Ted,
    If you did have the trial installed, you need to uninstall your paid-version. Get and run the Adobe Clean Script CS4 a couple of times. Check for any remaining Adobe folders and delete them. [I would also run a good Registry cleaner, like CCleaner, but that is up to you.] When done, do a full installation of CS4 and then run any updates. This should take care of it. Note: Adobe Clean Script CS4 is very, very important.
    Good luck,
    Hunt

  • Having problems with UTF-8 encoding from WinPhone

    Our sync server (GroupWise Mobility Server) - which supports EAS 14 - is failing to sync an item from a Windows Phone to our email application's calendar.
    As we look at the .ics file created by the Windows Phone, we notice that some characters are not UTF-8 characters as claimed (see .ics file below) and thus, do not decode properly and we drop the sync request.
    .ics file contents:
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft Windows Phone
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:Öйú±ê׼ʱ¼ä
    BEGIN:STANDARD
    DTSTART:20000101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:STANDARD
    END:VTIMEZONE
    BEGIN:VEVENT
    SUMMARY;CHARSET=UTF-8:好吧
    DESCRIPTION;CHARSET=UTF-8:我们俩人呢
    CLASS:PUBLIC
    LOCATION;CHARSET=UTF-8:嗯嗯
    UID:040000008200E00074C5B7101A82E00800000000B0AE9BBDCCB0E642A1A016ED65B5498
     0100000001A7F45FD22126646A347826899970D56
    DTSTART;TZID=Öйú±ê׼ʱ¼ä:20141024T160000
    DTEND;TZID=Öйú±ê׼ʱ¼ä:20141024T170000
    X-MICROSOFT-DISALLOW-COUNTER:FALSE
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    STATUS:CONFIRMED
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=DELEGATED;CN=¨¹?? ¨¹??:MAILTO:deu02@
     mydo43.com
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=user01 user01:MAILTO
     :[email protected]
    ORGANIZER:MAILTO:[email protected]
    DTSTAMP:20141024T075407Z
    LAST-MODIFIED:20141024T075407Z
    BEGIN:VALARM
    ACTION:DISPLAY
    DESCRIPTION:REMINDER
    TRIGGER:-PT15M
    END:VALARM
    END:VEVENT
    END:VCALENDAR

    We just took the Content-Type text/calendar portion, decoded it and this is what we were referring to as the meeting.ics.  
    Here is the MIME that the Windows 8 Phone sends:
    MIME-Version: 1.0
    To: =?utf-8?Q?=C3=BC=C3=B6=C3=A4_=C3=BC=C3=B6=C3=A4?= <[email protected]>,
            user01 user01 <[email protected]>
    Subject: =?utf-8?B?5aW95ZCn==?=
    Date: Fri, 24 Oct 2014 15:54:07 +0800
    Thread-Topic: =?utf-8?Q?=E5=A5=BD=E5=90=A7?=
    Content-Type: multipart/alternative;
            boundary="_6504CEF0-3696-4407-8129-C93E3F2622A6_"
    X-GWTO-BUFFER: =?utf-8?Q?=C3=BC=C3=B6=C3=A4_=C3=BC=C3=B6=C3=A4?=; user01 user01
    --_6504CEF0-3696-4407-8129-C93E3F2622A6_
    Content-Transfer-Encoding: base64
    Content-Type: text/plain; charset="utf-8"
    5oiR5Lus5L+p5Lq65ZGi
    --_6504CEF0-3696-4407-8129-C93E3F2622A6_
    Content-Type: text/calendar; charset="utf-8"; method=REQUEST
    Content-Transfer-Encoding: base64
    QkVHSU46VkNBTEVOREFSDQpNRVRIT0Q6UkVRVUVTVA0KUFJPRElEOk1pY3Jvc29mdCBXaW5kb3dz
    IFBob25lDQpWRVJTSU9OOjIuMA0KQkVHSU46VlRJTUVaT05FDQpUWklEOtbQufqx6te8yrG85A0K
    QkVHSU46U1RBTkRBUkQNCkRUU1RBUlQ6MjAwMDAxMDFUMDAwMDAwDQpUWk9GRlNFVEZST006KzA4
    MDANClRaT0ZGU0VUVE86KzA4MDANCkVORDpTVEFOREFSRA0KRU5EOlZUSU1FWk9ORQ0KQkVHSU46
    VkVWRU5UDQpTVU1NQVJZO0NIQVJTRVQ9VVRGLTg65aW95ZCnDQpERVNDUklQVElPTjtDSEFSU0VU
    PVVURi04OuaIkeS7rOS/qeS6uuWRog0KQ0xBU1M6UFVCTElDDQpMT0NBVElPTjtDSEFSU0VUPVVU
    Ri04OuWXr+WXrw0KVUlEOjA0MDAwMDAwODIwMEUwMDA3NEM1QjcxMDFBODJFMDA4MDAwMDAwMDBC
    MEFFOUJCRENDQjBFNjQyQTFBMDE2RUQ2NUI1NDk4DQogMDEwMDAwMDAwMUE3RjQ1RkQyMjEyNjY0
    NkEzNDc4MjY4OTk5NzBENTYNCkRUU1RBUlQ7VFpJRD3W0Ln6serXvMqxvOQ6MjAxNDEwMjRUMTYw
    MDAwDQpEVEVORDtUWklEPdbQufqx6te8yrG85DoyMDE0MTAyNFQxNzAwMDANClgtTUlDUk9TT0ZU
    LURJU0FMTE9XLUNPVU5URVI6RkFMU0UNClgtTUlDUk9TT0ZULUNETy1BTExEQVlFVkVOVDpGQUxT
    RQ0KU1RBVFVTOkNPTkZJUk1FRA0KQVRURU5ERUU7Uk9MRT1SRVEtUEFSVElDSVBBTlQ7UEFSVFNU
    QVQ9REVMRUdBVEVEO0NOPai5Pz8gqLk/PzpNQUlMVE86ZGV1MDJADQogbXlkbzQzLmNvbQ0KQVRU
    RU5ERUU7Uk9MRT1SRVEtUEFSVElDSVBBTlQ7UEFSVFNUQVQ9TkVFRFMtQUNUSU9OO0NOPXVzZXIw
    MSB1c2VyMDE6TUFJTFRPDQogOnVzZXIwMUBteWRvNDMuY29tDQpPUkdBTklaRVI6TUFJTFRPOmRl
    dTAyQG15ZG80My5jb20NCkRUU1RBTVA6MjAxNDEwMjRUMDc1NDA3Wg0KTEFTVC1NT0RJRklFRDoy
    MDE0MTAyNFQwNzU0MDdaDQpCRUdJTjpWQUxBUk0NCkFDVElPTjpESVNQTEFZDQpERVNDUklQVElP
    TjpSRU1JTkRFUg0KVFJJR0dFUjotUFQxNU0NCkVORDpWQUxBUk0NCkVORDpWRVZFTlQNCkVORDpW
    Q0FMRU5EQVINCg==
    --_6504CEF0-3696-4407-8129-C93E3F2622A6_--
    When you decode the text/calendar data, this is where you will find the characters that are not valid UTF-8.

  • Display a PDF returned as a base64 encoded clob from web service

    I'm trying to display a PDF document returned from a SOAP v1.1 web service. I'm able to return the XML into a collection using a process of type 'web service', but am struggling to display the document.
    This is the code I'm using to (attempt to) display the document, which doesn't return anything. If I exclude the clobbase642blob conversion an Adobe Reader pop-up appears, but I get an error message stating it is not a supported file type or the file has been damaged, which I would expect since it's a clob rather than a blob.
    DECLARE
      l_length    NUMBER;
      l_file_name VARCHAR2 (4000);
      l_file CLOB;
      l_blobfile BLOB;    
      l_ext VARCHAR2 (4000);
    BEGIN
      SELECT xtab."fileContent", xtab."fileName"
      INTO l_file, l_file_name
      FROM apex_collections c,
              XMLTable(XMLNAMESPACES(DEFAULT 'http://www.stellent.com/Payslip_Services/'),'//Payslip_Get_FileResponse/Payslip_Get_FileResult/downloadFile' passing xmltype001
                COLUMNS "fileContent" clob PATH 'fileContent'
                      , "fileName" PATH 'fileName'
              ) xtab
    where c.collection_name = 'P15_PAYSLIP_GET_FILE_RESULTS';
    l_blobfile := apex_web_service.clobbase642blob(l_file);
    l_length := DBMS_LOB.getlength(l_file);
      If INSTR (l_file_name, '.', -1, 1) > 0 then
          l_ext := SUBSTR (l_file_name, INSTR (l_file_name, '.', -1, 1) + 1);
      End if;
      IF (UPPER (l_ext) = 'PDF') THEN
        OWA_UTIL.mime_header ('application/pdf', FALSE);
      ELSIF (UPPER (l_ext) = 'DOC') THEN
        OWA_UTIL.mime_header ('application/msword', FALSE);
      ELSIF (UPPER (l_ext) = 'TXT') THEN
        OWA_UTIL.mime_header ('text/plain', FALSE);
      ELSIF (UPPER (l_ext) = 'HTML') THEN
        OWA_UTIL.mime_header ('text/html', FALSE);
      ELSE
        owa_util.mime_header('application/octet', FALSE );
      END IF;
      HTP.p ('Content-length: ' || l_length);
      HTP.p ( 'Content-Disposition: attachment; filename="' || l_file_name || '"' );
      OWA_UTIL.http_header_close;
      WPG_DOCLOAD.download_file (l_file);
    END;
    Apex 4.2.2
    Oracle 11g 11.2.0.1.0
    Any suggestions would be appreciated.
    Thanks,
    Graham

    What Adobe product is this a question for? This forum is for XML/API functionality for Adobe Connect. I'll move this question to the appropriate forum.

Maybe you are looking for

  • Moving a document library to the top level subsite

    Hi community  As part of period of extensive user engagement, I want to move the development documents library to the main community site I have set up for the project board ( rather than project office site where it is now).  Now I don't do this ver

  • Problem in XSL mapping with leading zero's

    Hi , i am facing a problem in disigning a XSL mapping where one of the source field (type string ) ,and I need to remove the leading zero's to map it to target. we have format-numer ,but It is not working in this case ,may be because of type string.

  • Visitor unabe to see the page content in WPC

    Hi Experts, I have created a website using  WPC, and I created a role and assigned the site to that role using external connector property.  I assigned that role to me and other users ( Authors, Visitors, Editors) . Problem is , I am able to see all

  • How long does it take for your billing address to be changed on your developer account

    So I contacted developer support yesterday to change my billing address so I could enroll into the ios development program. it's been nearly 24 hours and it still hasn't changed, how long does it usually take?

  • PROBLEM WITH COLMAP

    Hi all, When iam using CLOMAP in replicat it is failing with following error 2012-01-29 10:33:03 GGS ERROR 111 Oracle GoldenGate Delivery for Oracle, rtab1.prm: Error in COLMAP clause. 2012-01-29 10:33:03 GGS ERROR 190 Oracle GoldenGate Delivery for