4 Replies Latest reply: Apr 6, 2013 1:42 AM by Marwim RSS

    Open a File Dialog Box to browse through image files

    User542986-OC
      Hi all

      I need to develop a code to open a File Dialog Box to browse through Image Files in Oracle 10g.
      Once the Image File is selected i need to save the file in a Table Column in the Backend Table.

      Please help me.

      Thanks
      Nakul Venkatraman
        • 1. Re: Open a File Dialog Box to browse through image files
          Marwim
          Hello Nakul,

          you can open a file dialog with webutil_file, e.g. to allow multiple selects:
          DECLARE
              dirlist  webutil_file.file_list;
          BEGIN
              dirlist :=
                  webutil_file.directory_filtered_list(
                       <path>
                      ,file_filter => '*.jpg'
                      ,return_files_only      => TRUE
                      );
              ...
          END;
          Now you can transfer the files into a table with webutil_file_transfer.client_to_db_with_progress

          Uploading a file this way is simple, but not necessarily fast with large files. Other sugggestions you can find at {thread:id=2516745}

          Regards
          Marcus

          Edited by: Marwim on 05.04.2013 08:57
          • 2. Re: Open a File Dialog Box to browse through image files
            User542986-OC
            Hi

            Thanks for your prompt response on this.

            I came across a Sample Form File which would allow the User to browse through files from local PC.

            Following is the code :

            declare
            dirname varchar2(255);
            v_filename varchar2(255);
            begin
                 message('1');
            tool_env.getvar('E:\', dirname);
            message('2');
            dirname := dirname || '\project';
            message('3');
            v_filename := get_file_name(dirname,NULL,
            'All Files (*.*)|*.*|' ||
            'JPEG Files (*.jpg)|*.jpg|' ||
            'Bitmap Files (*.bmp)|*.bmp|' ||
            'TIFF Files (*.tif)|*.tif|' ||
            'CompuServe Files (*.gif)|*.gif|' ||
            'PC Paintbrush Files (*.pcx)|*.pcx|' );
            message('4');
            if v_filename is not null then
            read_image_file(v_filename,'ANY','pp_foto.foto');
            end if;
            end;

            The code is written inside WHEN-BUTTON-PRESSED Trigger.
            When i run the form it is not opening the dialog box.

            Please help.

            Regards
            Nakul
            • 3. Re: Open a File Dialog Box to browse through image files
              HamidHelal
              954804 wrote:
              Hi
              Hi Nakul
              Try it in easy way. Download Webutil Demo

              In the zip file your will get sample form and all are done for you. :)

              Hope this works..


              Hamid

              If someone's response is helpful or correct, please mark it accordingly.*
              • 4. Re: Open a File Dialog Box to browse through image files
                Marwim
                You didn't tell us your Forms version, but this example will only work in Client/Server.

                Use webutil for web-forms. Hamid posted a link to a demo that can show you what you need.