2 Replies Latest reply: Feb 14, 2013 6:29 AM by Carmine RSS

    Uploading file has insufficient privileges

    Carmine
      Hello. I have an application which will upload a file to its blob column. I followed all the examples/tutorials, but it is not working. Using the automatic DML, it puts the file into the apex_application files (I queried it and see it). I don't know what I'm missing to cause this issue. Any help would be greatly appreciated. The debug of the error is below.

      Thank you,
      -Carmine


      Here is the debug:
      0.04118     0.00154     ...Process "Process Row of IMAGE" - Type: DML_PROCESS_ROW
      0.04272     0.00130     ...Execute Statement: begin begin insert into "TESTSCHEMA"."IMAGE" ( "IMAGE_ID","SYSTEM_ID","IMAGE_DATA","IMAGE_FILENAME","IMAGE_MIMETYPE","IMAGE_CHARSET","IMAGE_DATE","DESCRIPTION","TIME_STAMP","MODIFIEDBY") values (:DML_BV0001,:DML_BV0002,empty_blob(),:DML_BV0003,:DML_BV0004,:DML_BV0005,to_date(:DML_BV0006, :p$_format_mask1),:DML_BV0007,to_timestamp(:DML_BV0008, :p$_format_mask2),:DML_BV0009) returning rowid into wwv_flow.g_dml_rowid; end; end;
      0.04401     0.00031     fname=F1932227671/file.jpg
      0.04432     0.00119     ...Execute Statement: begin begin update "TESTSCHEMA"."IMAGE" set "IMAGE_DATA" = (select BLOB_CONTENT from wwv_flow_files where name = :p_fname) , "IMAGE_MIMETYPE" = (select MIME_TYPE from wwv_flow_files where name = :p_fname) , "IMAGE_FILENAME" = (select FILENAME from wwv_flow_files where name = :p_fname) , "IMAGE_DATE" = sysdate where rowid = :p_rowid; delete from wwv_flow_files where name = :p_fname; end; end;
      0.04551     0.00028     Add error onto error stack
      0.04579     0.00025     ...Error data:
      0.04603     0.00027     ......message: ORA-06550: line 1, column 90: PL/SQL: ORA-01031: insufficient privileges ORA-06550: line 1, column 13: PL/SQL: SQL Statement ignored ORA-06550: line 1, column 347: PL/SQL: ORA-01031: insufficient privileges ORA-06550: line 1, column 335: PL/SQL: SQL Statement ignored
      0.04630     0.00024     ......additional_info: ORA-06550: line 1, column 90: PL/SQL: ORA-01031: insufficient privileges ORA-06550: line 1, column 13: PL/SQL: SQL Statement ignored ORA-06550: line 1, column 347: PL/SQL: ORA-01031: insufficient privileges ORA-06550: line 1, column 335: PL/SQL: SQL Statement ignored
      0.04654     0.00024     ......display_location: INLINE_IN_NOTIFICATION
      0.04678     0.00025     ......is_internal_error: false
      0.04703     0.00023     ......ora_sqlcode: -6550
      0.04727     0.00028     ......ora_sqlerrm: ORA-06550: line 1, column 90: PL/SQL: ORA-01031: insufficient privileges ORA-06550: line 1, column 13: PL/SQL: SQL Statement ignored ORA-06550: line 1, column 347: PL/SQL: ORA-01031: insufficient privileges ORA-06550: line 1, column 335: PL/SQL: SQL Statement ignored
      0.04754     0.00025     ......error_backtrace: ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 966 ORA-06512: at "SYS.WWV_DBMS_SQL", line 992 ORA-06512: at "APEX_040100.WWV_FLOW_DYNAMIC_EXEC", line 649 ORA-06512: at "APEX_040100.WWV_FLOW_DML", line 1373 ORA-06512: at "APEX_040100.WWV_FLOW_DML", line 1515 ORA-06512: at "APEX_040100.WWV_FLOW_PROCESS", line 354 
      0.04779     0.00030     ......component.type: APEX_APPLICATION_PAGE_PROCESS
      0.04809     0.00024     ......component.id: 2988231306220413
      0.04833     0.00037     ......component.name: Process Row of IMAGE
      0.04870     0.00022     Show current page with inline errors
        • 1. Re: Uploading file has insufficient privileges
          swesley_perth
          Awesome work posting the debug.

          Have you checked your application's parsing schema has access to testschema.image and wwv_flow_files?

          You've also constructed an overly complicated set of statements. It could be simplified as
          insert into image (...)
          select ... from wwv_flow_files 
          where ...;
          delete wwv_flow_files where...
          Scott
          • 2. Re: Uploading file has insufficient privileges
            Carmine
            It is a bit complicated, but I was trying to use the automatic DML instead of writing it myself. I kept looking at the parsing schema for privileges. It was not working. I followed the synonyms and views. It is because the installation of apex_040100 did not get grant option privilege to the underlying table. The following was needed:
            GRANT SELECT ON FLOWS_FILES.WWV_FLOW_FILE_OBJECTS$ TO APEX_040100 WITH GRANT OPTION;
            GRANT DELETE ON FLOWS_FILES.WWV_FLOW_FILE_OBJECTS$ TO APEX_040100 WITH GRANT OPTION;
            Thank you,
            -Carmine