2 Replies Latest reply: Mar 30, 2011 2:26 AM by 844401 RSS

    error: IMG-00705: unsupported or corrupted input format

    844401
      I am trying to upload a dwg document into database (through apex form) and I am getting this error:

      ORA-29400: data cartridge error IMG-00705: unsupported or corrupted input format

      I only get this error when I upload this document from a computer with a CAD software (dwg file is a CAD file).
      I don't get this error when I upload a dwg file from another computer (without any additional CAD software).

      Can anybody help me with this problem?

      I don't know if this is helpful, but this is the procedure which is triggered from my apex form to upload a document:

      FUNCTION UPLOAD_DOCUMENT(
      FILE_N VARCHAR2,
      DOC_NAME VARCHAR2,
      DOC_VALID_TO DATE,
      t_type varchar2 default null,
      DOC_TYPE_ID INTEGER DEFAULT NULL) RETURN INTEGER IS
      l_file_id number;
      l_thumb blob;
      l_file blob;
      l_mime_type varchar2(100);
      l_version varchar2(20) := '1.0';
      BEGIN

      select mime_type, blob_content INTO l_mime_type, l_thumb
      from wwv_flow_files
      where name = FILE_N;
      l_file := l_thumb;

      IF UPPER(LPAD(l_mime_type,5)) = 'IMAGE' THEN
      ordimage.process(l_thumb, 'maxScale=125 125');
      ELSE
      l_thumb := NULL;
      END IF;

      select T_DOCUMENT_SEQ.nextval into l_file_id from dual;

      INSERT INTO T_DOCUMENT
      +(doc_id, doc_name, doc_mimetype, doc_file,+
      doc_valid, doc_size,DOC_THUMBNAIL, DOC_SYNONYM,doc_type,
      doc_last_version, DOC_TYPE_ID)
      select l_file_id, filename, l_mime_type, l_file,
      DOC_VALID_TO, doc_size, l_thumb, DOC_NAME, t_type,
      l_version, DOC_TYPE_ID
      from wwv_flow_files where name = FILE_N;

      INSERT INTO T_FILE
      +( FLE_DATE, FLE_FILE, FLE_DOCUMENT_ID, FLE_TYPE, FLE_VERSION )+
      VALUES
      +( TRUNC(SYSDATE), l_file, l_file_id, 'DOCUMENT', l_version );+

      IF UPPER(LPAD(l_mime_type,5)) = 'IMAGE' THEN

      INSERT INTO T_FILE
      +( FLE_DATE, FLE_FILE, FLE_DOCUMENT_ID, FLE_TYPE, FLE_VERSION )+
      VALUES
      +( TRUNC(SYSDATE), l_thumb, l_file_id, 'THUMB', l_version );+

      END IF;

      delete from wwv_flow_files where name = FILE_N;

      COMMIT;

      RETURN l_file_id;

      END;
        • 1. Re: error: IMG-00705: unsupported or corrupted input format
          mannamal
          This error is probably raised by the ordimage.process call. Have you been able to verify that? Since dwg is not a supported format, an error would be raised during a process call.

          If so, is it possible that l_mime_type is different in both cases? So that in the case in which the error is not raised ordimage.process is not called?

          An image of type dwg can be loaded even if it is not a supported format. But it cannot be processed.

          Melli
          • 2. Re: error: IMG-00705: unsupported or corrupted input format
            844401
            Thank you so so much! That was really a problem and I changed the code:

            ...

            IF UPPER(LPAD(l_mime_type,5)) = 'IMAGE' THEN
            if upper(l_filename) like '%.DWG' then
            l_thumb := NULL;
            else
            ordimage.process(l_thumb, 'maxScale=125 125');
            end if;
            ELSE
            l_thumb := NULL;
            END IF;

            ....

            and now it is working. Thank you!