1 Reply Latest reply on Jul 2, 2018 11:54 AM by John_K

    Urgent: How to add new mime types and file formats in Oracle apps

    2943369

      Hi all,

       

      We are using e-Business Suite R12.2. Our Security Compliance team requested us to add around 600 mime type / file format combinations. I searched in the internet in order to accomplish that, however i have below issues:

      1. From front-end System Administrator responsibility --> Install --> Viewer options. In the file format LOV, there are only

       

      File formats.png

      from back-end. I run following script, however, it is erroring because it returns no data for rowid for the new mime-types that i want to add. T

       

       

       

      declare

       

      cursor c1 is select * from  xxhr.xxhr_allowed_file_types f;

      i number := 0;

      xrow varchar2(10) ;

      v_exists number;

      v_mime_type_id number;

      begin

        DBMS_OUTPUT.ENABLE(100000);

       

       

      for rec1 in c1 loop

       

        i := i +1;

       

        select count(*) into v_exists

        from fnd_mime_types f

        where (f.MIME_TYPE = rec1.mime_type

        and f.FILE_EXT = rec1.file_extension)

         or f.FILE_EXT  =rec1.file_extension ;

       

        if v_exists > 0 then

          dbms_output.put_line('------------- EXISTS --------- ' || i || ') Mime type: ' || rec1.mime_type ||'  Extension: ' || rec1.file_extension );

       

           select fnd_mime_types_s.NEXTVAL into v_mime_type_id from dual;

        

         FND_FILE_MIME_TYPES_PKG.update_row(X_MIME_TYPE_ID => v_mime_type_id,

                                         x_mime_type => rec1.mime_type,

                                         x_cp_format_code => '',

                                         x_ctx_format_code => '',

                                         x_last_update_date => sysdate,

                                         x_last_updated_by => fnd_global.USER_ID,

                                         x_file_ext => rec1.file_extension ,

                                         X_ALLOW_FILE_UPLOAD => 'N');

       

       

        else

       

       

        dbms_output.put_line( i || ') -------- NEW --------------- Mime type: ' || rec1.mime_type ||'   Extension: ' || rec1.file_extension );

       

        FND_FILE_MIME_TYPES_PKG.insert_row(x_rowid => xrow,

                                           x_mime_type => rec1.mime_type,

                                           x_created_by => fnd_global.USER_ID,

                                           x_last_updated_by => fnd_global.USER_ID,

                                           x_file_ext =>  rec1.file_extension,

                                           X_ALLOW_FILE_UPLOAD => 'N');

       

       

      end if;

      end loop;

       

       

      exception when others then

       

            dbms_output.put_line('Error: ' || SQLERRM);

            dbms_output.put_line('ERROR_STACK: ' || DBMS_UTILITY.FORMAT_ERROR_STACK);

            dbms_output.put_line('ERROR_BACKTRACE: ' || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE);

       

      end;

       

       

       

      and here is line 188 where it is erroring

      line 188.png

       

      and here is the C cursor (which is fetching rowid of that mime_type that i want to add, since it does not exist, no records are returned)

      cursor.png

       

      I tried to create a modified version of the package but modifying above part to the following

      MODIFIED.png

       

      Any idea please?? the project will not be launched till we accomplish and we are late.

       

       

      Regards,

        • 1. Re: Urgent: How to add new mime types and file formats in Oracle apps
          John_K

          I tried your scrit on a 12.1.3 system and it worked ok with a couple of tweaks (last_update_login needs to be populated as it's not nullable on the database and mime_type_id isn't a parameter to update_row).

           

          Interestingly on 12.1.3 the table handler doesn't seem to maintain the _TL table though. That said, it's not a public API, so technically it shouldn't be used.

           

          If it's an urgent request I'd suggest raising with Oracle support as people on these forums are just volunteers who answer in their own free time.