retrieve os file in oracle apex report












0















i have created a form with a 'browse item' and what ever file i am selecting using that item, i am storing it in to my operating system directory.



but i am not able to retrieve the same file into my classic report.



here is the procedure i am using to write the uploaded item into os file system.



create or replace procedure write_to_file (



p_file_name in varchar2



, p_directory in varchar2



, p_content in blob



) is



l_file          utl_file.file_type;

l_buffer raw(32000);

l_amount binary_integer := 32000;

l_pos integer := 1;

l_blob blob;

l_blob_left number;

l_blob_length number;


begin



l_blob_length := dbms_lob.getlength(p_content);



l_blob_left := l_blob_length;



-- open the destination file.



l_file := utl_file.fopen(p_directory,p_file_name,'WB', 32760);



-- read chunks of the blob and write them to the file



-- until complete.



-- if small enough for a single write



if l_blob_length < 32760 then



utl_file.put_raw(l_file,p_content);



utl_file.fflush(l_file);



else -- write in pieces



l_pos := 1;



while l_pos < l_blob_length



loop



dbms_lob.read(p_content,l_amount,l_pos,l_buffer);



utl_file.put_raw(l_file,l_buffer);



utl_file.fflush(l_file);



-- set the start position for the next cut



l_pos := l_pos + l_amount;



-- set the end position if less than 32000 bytes



l_blob_left := l_blob_left - l_amount;



if l_blob_left < 32000 then



 l_amount := l_blob_left;


end if;



end loop;



end if;



utl_file.fclose(l_file);



exception



when others then



-- close the file if something goes wrong.



if utl_file.is_open(l_file) then



utl_file.fclose(l_file);



end if;



raise;



end;



can anyone help me to retrieve the same file into my apex report ?










share|improve this question



























    0















    i have created a form with a 'browse item' and what ever file i am selecting using that item, i am storing it in to my operating system directory.



    but i am not able to retrieve the same file into my classic report.



    here is the procedure i am using to write the uploaded item into os file system.



    create or replace procedure write_to_file (



    p_file_name in varchar2



    , p_directory in varchar2



    , p_content in blob



    ) is



    l_file          utl_file.file_type;

    l_buffer raw(32000);

    l_amount binary_integer := 32000;

    l_pos integer := 1;

    l_blob blob;

    l_blob_left number;

    l_blob_length number;


    begin



    l_blob_length := dbms_lob.getlength(p_content);



    l_blob_left := l_blob_length;



    -- open the destination file.



    l_file := utl_file.fopen(p_directory,p_file_name,'WB', 32760);



    -- read chunks of the blob and write them to the file



    -- until complete.



    -- if small enough for a single write



    if l_blob_length < 32760 then



    utl_file.put_raw(l_file,p_content);



    utl_file.fflush(l_file);



    else -- write in pieces



    l_pos := 1;



    while l_pos < l_blob_length



    loop



    dbms_lob.read(p_content,l_amount,l_pos,l_buffer);



    utl_file.put_raw(l_file,l_buffer);



    utl_file.fflush(l_file);



    -- set the start position for the next cut



    l_pos := l_pos + l_amount;



    -- set the end position if less than 32000 bytes



    l_blob_left := l_blob_left - l_amount;



    if l_blob_left < 32000 then



     l_amount := l_blob_left;


    end if;



    end loop;



    end if;



    utl_file.fclose(l_file);



    exception



    when others then



    -- close the file if something goes wrong.



    if utl_file.is_open(l_file) then



    utl_file.fclose(l_file);



    end if;



    raise;



    end;



    can anyone help me to retrieve the same file into my apex report ?










    share|improve this question

























      0












      0








      0








      i have created a form with a 'browse item' and what ever file i am selecting using that item, i am storing it in to my operating system directory.



      but i am not able to retrieve the same file into my classic report.



      here is the procedure i am using to write the uploaded item into os file system.



      create or replace procedure write_to_file (



      p_file_name in varchar2



      , p_directory in varchar2



      , p_content in blob



      ) is



      l_file          utl_file.file_type;

      l_buffer raw(32000);

      l_amount binary_integer := 32000;

      l_pos integer := 1;

      l_blob blob;

      l_blob_left number;

      l_blob_length number;


      begin



      l_blob_length := dbms_lob.getlength(p_content);



      l_blob_left := l_blob_length;



      -- open the destination file.



      l_file := utl_file.fopen(p_directory,p_file_name,'WB', 32760);



      -- read chunks of the blob and write them to the file



      -- until complete.



      -- if small enough for a single write



      if l_blob_length < 32760 then



      utl_file.put_raw(l_file,p_content);



      utl_file.fflush(l_file);



      else -- write in pieces



      l_pos := 1;



      while l_pos < l_blob_length



      loop



      dbms_lob.read(p_content,l_amount,l_pos,l_buffer);



      utl_file.put_raw(l_file,l_buffer);



      utl_file.fflush(l_file);



      -- set the start position for the next cut



      l_pos := l_pos + l_amount;



      -- set the end position if less than 32000 bytes



      l_blob_left := l_blob_left - l_amount;



      if l_blob_left < 32000 then



       l_amount := l_blob_left;


      end if;



      end loop;



      end if;



      utl_file.fclose(l_file);



      exception



      when others then



      -- close the file if something goes wrong.



      if utl_file.is_open(l_file) then



      utl_file.fclose(l_file);



      end if;



      raise;



      end;



      can anyone help me to retrieve the same file into my apex report ?










      share|improve this question














      i have created a form with a 'browse item' and what ever file i am selecting using that item, i am storing it in to my operating system directory.



      but i am not able to retrieve the same file into my classic report.



      here is the procedure i am using to write the uploaded item into os file system.



      create or replace procedure write_to_file (



      p_file_name in varchar2



      , p_directory in varchar2



      , p_content in blob



      ) is



      l_file          utl_file.file_type;

      l_buffer raw(32000);

      l_amount binary_integer := 32000;

      l_pos integer := 1;

      l_blob blob;

      l_blob_left number;

      l_blob_length number;


      begin



      l_blob_length := dbms_lob.getlength(p_content);



      l_blob_left := l_blob_length;



      -- open the destination file.



      l_file := utl_file.fopen(p_directory,p_file_name,'WB', 32760);



      -- read chunks of the blob and write them to the file



      -- until complete.



      -- if small enough for a single write



      if l_blob_length < 32760 then



      utl_file.put_raw(l_file,p_content);



      utl_file.fflush(l_file);



      else -- write in pieces



      l_pos := 1;



      while l_pos < l_blob_length



      loop



      dbms_lob.read(p_content,l_amount,l_pos,l_buffer);



      utl_file.put_raw(l_file,l_buffer);



      utl_file.fflush(l_file);



      -- set the start position for the next cut



      l_pos := l_pos + l_amount;



      -- set the end position if less than 32000 bytes



      l_blob_left := l_blob_left - l_amount;



      if l_blob_left < 32000 then



       l_amount := l_blob_left;


      end if;



      end loop;



      end if;



      utl_file.fclose(l_file);



      exception



      when others then



      -- close the file if something goes wrong.



      if utl_file.is_open(l_file) then



      utl_file.fclose(l_file);



      end if;



      raise;



      end;



      can anyone help me to retrieve the same file into my apex report ?







      apex utl-file






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 1 at 9:37









      himansuhimansu

      12




      12
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994401%2fretrieve-os-file-in-oracle-apex-report%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994401%2fretrieve-os-file-in-oracle-apex-report%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

          How to fix TextFormField cause rebuild widget in Flutter