OTCS REST API - Define Document Mime Type?

Hi, is is possible to define a MIME type for a document when using the REST API? We are using Content Server version 16.2.3.

The reason for the question is that when we add an Office document to Content Server using the REST API, the MIME type is showing the correct value. However, we are unable to edit the document. When changing the MIME type within the document Properties -> Specific -> MIME Type to something other than the current MIME type, and then change it back to what it was originally set, the document then becomes editable.

Here is the Java code that performs the document upload operation:

MultiPart multipartEntity = new FormDataMultiPart().field("type", type).field("parent_id", parent_id).field("name", name);

    if (row.getValue().get("file") != null) {
        String tempFileName = getConversion().convert(row.getValue().get("file"), String.class);
        File tempFile = new File(getMetadata().calculateTempFolder(), tempFileName);

        FileDataBodyPart filePart = new FileDataBodyPart("file", tempFile);
        filePart.setContentDisposition(FormDataContentDisposition.name("file").fileName(name).build());
        multipartEntity = multipartEntity.bodyPart(filePart);
    }

    return getService().post(target, Entity.entity(multipartEntity, multipartEntity.getMediaType()));

Thanks in advance.

Comments

  • what errors do you get in the UI / logs when you try and edit the uploaded document ?

  • There are no errors present as the option to edit is just not there. The only options are open, download, and comments. I can even view the document as Web Page. Here is the output when the document is added:

    02/28/2019 09:51:24 TRACE CrackRequestStream: Strict Args from request data length = 28324 type: multipart/form-data;boundary=Boundary_10_231407556_1551376284572.
    02/28/2019 09:51:24 TRACE CrackMultipart: parse POST data with boundary = --Boundary_10_231407556_1551376284572
    02/28/2019 09:51:24 DEBUG KHTTPArgs::GotoNextPart start -- 9:51:24 (15) [2324898335666]  28324
    02/28/2019 09:51:24 TRACE KHTTPArgs::FillEmptyReadBuf try to read bytes from client socket istream: 28324
    02/28/2019 09:51:25 DEBUG KHTTPArgs::FillEmptyReadBuf end -- 9:51:25 (1035) [2324899351285] read 28324 more bytes into buffer.
    02/28/2019 09:51:25 DEBUG KHTTPArgs::ReadMoreUntil end -- 9:51:25 (1035) [2324899351371]  returned 37 bytes and found the until string.
    02/28/2019 09:51:25 DEBUG KHTTPArgs::GotoNextPart end -- 9:51:25 (1035) [2324899351410]  28285 part size was: 0
    02/28/2019 09:51:25 INFO  type = 144  9:51:25 (1035) [2324899351506]
    02/28/2019 09:51:25 INFO  parent_id = 50635975  9:51:25 (1035) [2324899351558]
    02/28/2019 09:51:25 INFO  name = WordDocument-8.docx  9:51:25 (1035) [2324899351629]
    02/28/2019 09:51:25 WARN  unused form-data key: modification-date
    02/28/2019 09:51:25 WARN  unused form-data key: size
    02/28/2019 09:51:25 INFO  KHTTPArgs::GetNextPart using temporary file: C:\windows\TEMP\otupB828D2AB65C540BAAEADECEDF6D3A9A70 9:51:25 (1035) [2324899352002]  
    02/28/2019 09:51:25 DEBUG KHTTPArgs::GotoNextPart start -- 9:51:25 (1035) [2324899352034]  27723
    02/28/2019 09:51:25 DEBUG KHTTPArgs::ReadMoreUntil end -- 9:51:25 (1035) [2324899352117]  returned 27719 bytes and found the until string.
    02/28/2019 09:51:25 DEBUG KHTTPArgs::GotoNextPart end -- 9:51:25 (1035) [2324899352267]  2 part size was: 27680
    02/28/2019 09:51:25 INFO  file_filename = file532659969527349840  9:51:25 (1035) [2324899352540]
    02/28/2019 09:51:25 INFO  file_filelength = 27680  9:51:25 (1035) [2324899352581]
    02/28/2019 09:51:25 INFO  file_content_type =   9:51:25 (1035) [2324899352656]
    02/28/2019 09:51:25 INFO  file = C:\windows\TEMP\otupB828D2AB65C540BAAEADECEDF6D3A9A70  9:51:25 (1035) [2324899352689]
    02/28/2019 09:51:25 INFO  REQUEST_ID = '771e0429-3b81-11e9-a1f3-0050562163e0'
    02/28/2019 09:51:25 DEBUG KWSASocket::OpenServiceAsClient() fd = 508
    02/28/2019 09:51:25 DEBUG KWSASocket::OpenServiceAsClient for ai_family 2 socktype 1 ai_protocol 0
    02/28/2019 09:51:25 INFO  KLLClient::OpenConnection connected to server testDNS:2099  9:51:25 (1035) [2324899356304]
    02/28/2019 09:51:25 INFO  Open client SUCCESS  9:51:25 (1035) [2324899356358]
    02/28/2019 09:51:25 INFO  Sending request to server begin --  9:51:25 (1035) [2324899356381]
    02/28/2019 09:51:25 TRACE KSocketStream::SubclassFlush...WRITING...bufferSize=3111
    02/28/2019 09:51:25 DEBUG KWSASocket::WriteWithTimeout(): Ignoring a timeout value of zero; socket may block indefinitely.
    02/28/2019 09:51:25 TRACE KSocketStream::SubclassFlush...WRITTEN...retval=3111
    02/28/2019 09:51:25 INFO  Sending request to server end, waiting for response --  9:51:25 (1035) [2324899356648]
    
  • There are no errors present as the option to edit is just not there. The only options are open, download, and comments. I can even view the document as Web Page. Here is the output when the document is added:

    02/28/2019 09:51:24 TRACE CrackRequestStream: Strict Args from request data length = 28324 type: multipart/form-data;boundary=Boundary_10_231407556_1551376284572.
    02/28/2019 09:51:24 TRACE CrackMultipart: parse POST data with boundary = --Boundary_10_231407556_1551376284572
    02/28/2019 09:51:24 DEBUG KHTTPArgs::GotoNextPart start -- 9:51:24 (15) [2324898335666]  28324
    02/28/2019 09:51:24 TRACE KHTTPArgs::FillEmptyReadBuf try to read bytes from client socket istream: 28324
    02/28/2019 09:51:25 DEBUG KHTTPArgs::FillEmptyReadBuf end -- 9:51:25 (1035) [2324899351285] read 28324 more bytes into buffer.
    02/28/2019 09:51:25 DEBUG KHTTPArgs::ReadMoreUntil end -- 9:51:25 (1035) [2324899351371]  returned 37 bytes and found the until string.
    02/28/2019 09:51:25 DEBUG KHTTPArgs::GotoNextPart end -- 9:51:25 (1035) [2324899351410]  28285 part size was: 0
    02/28/2019 09:51:25 INFO  type = 144  9:51:25 (1035) [2324899351506]
    02/28/2019 09:51:25 INFO  parent_id = 50635975  9:51:25 (1035) [2324899351558]
    02/28/2019 09:51:25 INFO  name = WordDocument-8.docx  9:51:25 (1035) [2324899351629]
    02/28/2019 09:51:25 WARN  unused form-data key: modification-date
    02/28/2019 09:51:25 WARN  unused form-data key: size
    02/28/2019 09:51:25 INFO  KHTTPArgs::GetNextPart using temporary file: C:\windows\TEMP\otupB828D2AB65C540BAAEADECEDF6D3A9A70 9:51:25 (1035) [2324899352002]  
    02/28/2019 09:51:25 DEBUG KHTTPArgs::GotoNextPart start -- 9:51:25 (1035) [2324899352034]  27723
    02/28/2019 09:51:25 DEBUG KHTTPArgs::ReadMoreUntil end -- 9:51:25 (1035) [2324899352117]  returned 27719 bytes and found the until string.
    02/28/2019 09:51:25 DEBUG KHTTPArgs::GotoNextPart end -- 9:51:25 (1035) [2324899352267]  2 part size was: 27680
    02/28/2019 09:51:25 INFO  file_filename = file532659969527349840  9:51:25 (1035) [2324899352540]
    02/28/2019 09:51:25 INFO  file_filelength = 27680  9:51:25 (1035) [2324899352581]
    02/28/2019 09:51:25 INFO  file_content_type =   9:51:25 (1035) [2324899352656]
    02/28/2019 09:51:25 INFO  file = C:\windows\TEMP\otupB828D2AB65C540BAAEADECEDF6D3A9A70  9:51:25 (1035) [2324899352689]
    02/28/2019 09:51:25 INFO  REQUEST_ID = '771e0429-3b81-11e9-a1f3-0050562163e0'
    02/28/2019 09:51:25 DEBUG KWSASocket::OpenServiceAsClient() fd = 508
    02/28/2019 09:51:25 DEBUG KWSASocket::OpenServiceAsClient for ai_family 2 socktype 1 ai_protocol 0
    02/28/2019 09:51:25 INFO  KLLClient::OpenConnection connected to server testDNS:2099  9:51:25 (1035) [2324899356304]
    02/28/2019 09:51:25 INFO  Open client SUCCESS  9:51:25 (1035) [2324899356358]
    02/28/2019 09:51:25 INFO  Sending request to server begin --  9:51:25 (1035) [2324899356381]
    02/28/2019 09:51:25 TRACE KSocketStream::SubclassFlush...WRITING...bufferSize=3111
    02/28/2019 09:51:25 DEBUG KWSASocket::WriteWithTimeout(): Ignoring a timeout value of zero; socket may block indefinitely.
    02/28/2019 09:51:25 TRACE KSocketStream::SubclassFlush...WRITTEN...retval=3111
    02/28/2019 09:51:25 INFO  Sending request to server end, waiting for response --  9:51:25 (1035) [2324899356648]
    
  • I was looking for the logs from the Content Server side after the upload on the screen where the Edit option does not immediately appear. Looking at the code there are some checks that happen before the button is shown. The code is in $WebEdit.WebNodeCmds.Edit.IsEnabled

  • Apologies, I cannot find the that specific code you are referring to. I tried looking through the CGI and thread logs and found no reference to that specific code. Can you provide additional information as to where I can find it? Thanks.

    EDIT - additional info: I have all Content Server logging set to TRACE.

  • The logs at the time of the "issue" may show what was the cause of the problem. The reference to $WebEdit.WebNodeCmds.Edit.IsEnabled was to show you where in the Developer SDK you can find the code that controls the display, so if you had the SDK you could debug directly.

  • We are not using the SDK, so I hope these logs provide some insight.

    CGI Log:

    03/07/2019 10:42:21 TRACE CrackRequestStream: Strict Args from request data length = 15402 type: multipart/form-data;boundary=Boundary_559_660126739_1551984141593.
    03/07/2019 10:42:21 TRACE CrackMultipart: parse POST data with boundary = --Boundary_559_660126739_1551984141593
    03/07/2019 10:42:21 DEBUG KHTTPArgs::GotoNextPart start -- 10:42:21 (15) [2932761889427]  15402
    03/07/2019 10:42:21 TRACE KHTTPArgs::FillEmptyReadBuf try to read bytes from client socket istream: 15402
    03/07/2019 10:42:21 DEBUG KHTTPArgs::FillEmptyReadBuf end -- 10:42:21 (62) [2932761924812] read 15402 more bytes into buffer.
    03/07/2019 10:42:21 DEBUG KHTTPArgs::ReadMoreUntil end -- 10:42:21 (62) [2932761924852]  returned 38 bytes and found the until string.
    03/07/2019 10:42:21 DEBUG KHTTPArgs::GotoNextPart end -- 10:42:21 (62) [2932761924884]  15362 part size was: 0
    03/07/2019 10:42:21 INFO  type = 144  10:42:21 (62) [2932761924950]
    03/07/2019 10:42:21 INFO  parent_id = 50635512  10:42:21 (62) [2932761924991]
    03/07/2019 10:42:21 INFO  name = TESTING Document.docx  10:42:21 (62) [2932761925026]
    03/07/2019 10:42:21 WARN  unused form-data key: modification-date
    03/07/2019 10:42:21 WARN  unused form-data key: size
    03/07/2019 10:42:21 INFO  KHTTPArgs::GetNextPart using temporary file: C:\windows\TEMP\otup3459392B343543DC89A49DEDCFE81F830 10:42:21 (62) [2932761925294]  
    03/07/2019 10:42:21 DEBUG KHTTPArgs::GotoNextPart start -- 10:42:21 (62) [2932761925326]  14794
    03/07/2019 10:42:21 DEBUG KHTTPArgs::ReadMoreUntil end -- 10:42:21 (62) [2932761925378]  returned 14790 bytes and found the until string.
    03/07/2019 10:42:21 DEBUG KHTTPArgs::GotoNextPart end -- 10:42:21 (62) [2932761925517]  2 part size was: 14750
    03/07/2019 10:42:21 INFO  file_filename = file1131425378715884024  10:42:21 (62) [2932761925747]
    03/07/2019 10:42:21 INFO  file_filelength = 14750  10:42:21 (62) [2932761925787]
    03/07/2019 10:42:21 INFO  file_content_type =   10:42:21 (62) [2932761925813]
    03/07/2019 10:42:21 INFO  file = C:\windows\TEMP\otup3459392B343543DC89A49DEDCFE81F830  10:42:21 (62) [2932761925837]
    03/07/2019 10:42:21 INFO  REQUEST_ID = 'be197507-4108-11e9-bee3-0050562163e0'
    03/07/2019 10:42:21 DEBUG KWSASocket::OpenServiceAsClient() fd = 80
    03/07/2019 10:42:21 DEBUG KWSASocket::OpenServiceAsClient for ai_family 2 socktype 1 ai_protocol 0
    03/07/2019 10:42:21 INFO  KLLClient::OpenConnection connected to server testdns:2099  10:42:21 (62) [2932761929607]
    03/07/2019 10:42:21 INFO  Open client SUCCESS  10:42:21 (62) [2932761929659]
    03/07/2019 10:42:21 INFO  Sending request to server begin --  10:42:21 (62) [2932761929683]
    03/07/2019 10:42:21 TRACE KSocketStream::SubclassFlush...WRITING...bufferSize=3125
    03/07/2019 10:42:21 DEBUG KWSASocket::WriteWithTimeout(): Ignoring a timeout value of zero; socket may block indefinitely.
    03/07/2019 10:42:21 TRACE KSocketStream::SubclassFlush...WRITTEN...retval=3125
    03/07/2019 10:42:21 INFO  Sending request to server end, waiting for response --  10:42:21 (62) [2932761929927]
    

    Thread log:

    03/07/2019 10:42:21 INFO  Thu Mar 07 10:42:21 2019
    03/07/2019 10:42:21 INFO  _REQUEST = 'llweb'
    03/07/2019 10:42:21 INFO  AUTH_TYPE = ''
    03/07/2019 10:42:21 INFO  CONTENT_LENGTH = '15402'
    03/07/2019 10:42:21 INFO  CONTENT_TYPE = 'multipart/form-data;boundary=Boundary_559_660126739_1551984141593'
    03/07/2019 10:42:21 INFO  file = 'C:\windows\TEMP\otup3459392B343543DC89A49DEDCFE81F830'
    03/07/2019 10:42:21 INFO  file_content_type = ''
    03/07/2019 10:42:21 INFO  file_filelength = '14750'
    03/07/2019 10:42:21 INFO  file_filename = 'file1131425378715884024'
    03/07/2019 10:42:21 INFO  GATEWAY_INTERFACE = 'CGI/1.1'
    03/07/2019 10:42:21 INFO  HTTP_ACCEPT = 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2'
    03/07/2019 10:42:21 INFO  HTTP_CACHE_CONTROL = 'no-cache'
    03/07/2019 10:42:21 INFO  HTTP_CONNECTION = 'keep-alive'
    03/07/2019 10:42:21 INFO  HTTP_CONTENT_LENGTH = '15402'
    03/07/2019 10:42:21 INFO  HTTP_CONTENT_TYPE = 'multipart/form-data;boundary=Boundary_559_660126739_1551984141593'
    03/07/2019 10:42:21 INFO  HTTP_HOST = 'testdns'
    03/07/2019 10:42:21 INFO  HTTP_MIME_VERSION = '1.0'
    03/07/2019 10:42:21 INFO  HTTP_OTCSTICKET = 'fa2wG3rrlpZcqB5TvlZMs+yK/SReFluVR9XWrC0qvMM4+KoCFAdy/j+vdSJ3dumXQgshDuFDVjgpyBzbN51hw74HWTDCsGrd'
    03/07/2019 10:42:21 INFO  HTTP_PRAGMA = 'no-cache'
    03/07/2019 10:42:21 INFO  HTTP_USER_AGENT = 'Jersey/2.22.2 (HttpUrlConnection 1.8.0_191)'
    03/07/2019 10:42:21 INFO  HTTP_X_FORWARDED_FOR = '204.17.10.56'
    03/07/2019 10:42:21 INFO  HTTP_X_FORWARDED_PROTO = 'https'
    03/07/2019 10:42:21 INFO  HTTPS = 'off'
    03/07/2019 10:42:21 INFO  HTTPS_KEYSIZE = ''
    03/07/2019 10:42:21 INFO  HTTPS_SECRETKEYSIZE = ''
    03/07/2019 10:42:21 INFO  HTTPS_SERVER_ISSUER = ''
    03/07/2019 10:42:21 INFO  HTTPS_SERVER_SUBJECT = ''
    03/07/2019 10:42:21 INFO  LLSYSPARAMS_ASSOC = 'A<1,?,''_uploadPath''=''C:\\windows\\TEMP\\''>'
    03/07/2019 10:42:21 INFO  name = 'TESTING Document.docx'
    03/07/2019 10:42:21 INFO  parent_id = '50635512'
    03/07/2019 10:42:21 INFO  PATH_INFO = '/api/v2/nodes'
    03/07/2019 10:42:21 INFO  PATH_TRANSLATED = 'C:\inetpub\wwwroot\api\v2\nodes'
    03/07/2019 10:42:21 INFO  QUERY_STRING = ''
    03/07/2019 10:42:21 INFO  REMOTE_ADDR = '10.0.150.236'
    03/07/2019 10:42:21 INFO  REMOTE_HOST = '10.0.150.236'
    03/07/2019 10:42:21 INFO  REMOTE_USER = ''
    03/07/2019 10:42:21 INFO  REQUEST_ID = 'be197507-4108-11e9-bee3-0050562163e0'
    03/07/2019 10:42:21 INFO  REQUEST_METHOD = 'POST'
    03/07/2019 10:42:21 INFO  REQUEST_PROCESSING_DURATION = '0'
    03/07/2019 10:42:21 INFO  SCRIPT_NAME = '/otcs/cs.exe'
    03/07/2019 10:42:21 INFO  SERVER_NAME = 'testdns'
    03/07/2019 10:42:21 INFO  SERVER_PORT = '80'
    03/07/2019 10:42:21 INFO  SERVER_PROTOCOL = 'HTTP/1.1'
    03/07/2019 10:42:21 INFO  SERVER_SOFTWARE = 'Microsoft-IIS/10.0'
    03/07/2019 10:42:21 INFO  type = '144'
    03/07/2019 10:42:21 TRACE KOSValue::Initialize: Cannot default initialize value of type -127, setting to undefined
    

    I have some additional information: when adding a new version to that document that we were previously unable to edit, the MIME type is defined and the document is editable. Here are the logs from that process:

    CGI:

    03/07/2019 10:54:41 TRACE CrackRequestStream: Strict Args from request data length = 15407 type: multipart/form-data;boundary=Boundary_579_304882251_1551984881396.
    03/07/2019 10:54:41 TRACE CrackMultipart: parse POST data with boundary = --Boundary_579_304882251_1551984881396
    03/07/2019 10:54:41 DEBUG KHTTPArgs::GotoNextPart start -- 10:54:41 (31) [2933501700424]  15407
    03/07/2019 10:54:41 TRACE KHTTPArgs::FillEmptyReadBuf try to read bytes from client socket istream: 15407
    03/07/2019 10:54:41 DEBUG KHTTPArgs::FillEmptyReadBuf end -- 10:54:41 (62) [2933501738984] read 15407 more bytes into buffer.
    03/07/2019 10:54:41 DEBUG KHTTPArgs::ReadMoreUntil end -- 10:54:41 (62) [2933501739023]  returned 38 bytes and found the until string.
    03/07/2019 10:54:41 DEBUG KHTTPArgs::GotoNextPart end -- 10:54:41 (62) [2933501739043]  15367 part size was: 0
    03/07/2019 10:54:41 INFO  id = 50668948  10:54:41 (62) [2933501739103]
    03/07/2019 10:54:41 INFO  add_major_version = true  10:54:41 (62) [2933501739146]
    03/07/2019 10:54:41 INFO  name = TESTING Document.docx  10:54:41 (62) [2933501739180]
    03/07/2019 10:54:41 WARN  unused form-data key: modification-date
    03/07/2019 10:54:41 WARN  unused form-data key: size
    03/07/2019 10:54:41 INFO  KHTTPArgs::GetNextPart using temporary file: C:\windows\TEMP\otupCF10AE9ACB8B41B3A120BACB730FE8CD0 10:54:41 (62) [2933501739443]  
    03/07/2019 10:54:41 DEBUG KHTTPArgs::GotoNextPart start -- 10:54:41 (62) [2933501739474]  14794
    03/07/2019 10:54:41 DEBUG KHTTPArgs::ReadMoreUntil end -- 10:54:41 (62) [2933501739525]  returned 14790 bytes and found the until string.
    03/07/2019 10:54:41 DEBUG KHTTPArgs::GotoNextPart end -- 10:54:41 (62) [2933501739634]  2 part size was: 14750
    03/07/2019 10:54:41 INFO  file_filename = TESTING Document.docx  10:54:41 (62) [2933501739840]
    03/07/2019 10:54:41 INFO  file_filelength = 14750  10:54:41 (62) [2933501739881]
    03/07/2019 10:54:41 INFO  file_content_type =   10:54:41 (62) [2933501739940]
    03/07/2019 10:54:41 INFO  file = C:\windows\TEMP\otupCF10AE9ACB8B41B3A120BACB730FE8CD0  10:54:41 (62) [2933501739971]
    03/07/2019 10:54:41 INFO  REQUEST_ID = '770a3ebf-410a-11e9-85d0-0050562163e0'
    03/07/2019 10:54:41 DEBUG KWSASocket::OpenServiceAsClient() fd = 512
    03/07/2019 10:54:41 DEBUG KWSASocket::OpenServiceAsClient for ai_family 2 socktype 1 ai_protocol 0
    03/07/2019 10:54:41 INFO  KLLClient::OpenConnection connected to server testdns:2099  10:54:41 (78) [2933501743370]
    03/07/2019 10:54:41 INFO  Open client SUCCESS  10:54:41 (78) [2933501743424]
    03/07/2019 10:54:41 INFO  Sending request to server begin --  10:54:41 (78) [2933501743445]
    03/07/2019 10:54:41 TRACE KSocketStream::SubclassFlush...WRITING...bufferSize=3211
    03/07/2019 10:54:41 DEBUG KWSASocket::WriteWithTimeout(): Ignoring a timeout value of zero; socket may block indefinitely.
    03/07/2019 10:54:41 TRACE KSocketStream::SubclassFlush...WRITTEN...retval=3211
    03/07/2019 10:54:41 INFO  Sending request to server end, waiting for response --  10:54:41 (78) [2933501743709]
    

    Thread:

    03/07/2019 10:54:41 INFO  Thu Mar 07 10:54:41 2019
    03/07/2019 10:54:41 INFO  _REQUEST = 'llweb'
    03/07/2019 10:54:41 INFO  add_major_version = 'true'
    03/07/2019 10:54:41 INFO  AUTH_TYPE = ''
    03/07/2019 10:54:41 INFO  CONTENT_LENGTH = '15407'
    03/07/2019 10:54:41 INFO  CONTENT_TYPE = 'multipart/form-data;boundary=Boundary_579_304882251_1551984881396'
    03/07/2019 10:54:41 INFO  file = 'C:\windows\TEMP\otupCF10AE9ACB8B41B3A120BACB730FE8CD0'
    03/07/2019 10:54:41 INFO  file_content_type = ''
    03/07/2019 10:54:41 INFO  file_filelength = '14750'
    03/07/2019 10:54:41 INFO  file_filename = 'TESTING Document.docx'
    03/07/2019 10:54:41 INFO  GATEWAY_INTERFACE = 'CGI/1.1'
    03/07/2019 10:54:41 INFO  HTTP_ACCEPT = 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2'
    03/07/2019 10:54:41 INFO  HTTP_CACHE_CONTROL = 'no-cache'
    03/07/2019 10:54:41 INFO  HTTP_CONNECTION = 'keep-alive'
    03/07/2019 10:54:41 INFO  HTTP_CONTENT_LENGTH = '15407'
    03/07/2019 10:54:41 INFO  HTTP_CONTENT_TYPE = 'multipart/form-data;boundary=Boundary_579_304882251_1551984881396'
    03/07/2019 10:54:41 INFO  HTTP_HOST = 'testdns'
    03/07/2019 10:54:41 INFO  HTTP_MIME_VERSION = '1.0'
    03/07/2019 10:54:41 INFO  HTTP_OTCSTICKET = 'wRt6nMHmdSnA8IHzWBoQZ25ysdK7FpIaBjqi4C5RlYpWsMOCg80T+8rxU2X9P6nXuIuBkI+akORjdg/VNjmYK0orDKggdQmX'
    03/07/2019 10:54:41 INFO  HTTP_PRAGMA = 'no-cache'
    03/07/2019 10:54:41 INFO  HTTP_USER_AGENT = 'Jersey/2.22.2 (HttpUrlConnection 1.8.0_191)'
    03/07/2019 10:54:41 INFO  HTTP_X_FORWARDED_FOR = '204.17.10.56'
    03/07/2019 10:54:41 INFO  HTTP_X_FORWARDED_PROTO = 'https'
    03/07/2019 10:54:41 INFO  HTTPS = 'off'
    03/07/2019 10:54:41 INFO  HTTPS_KEYSIZE = ''
    03/07/2019 10:54:41 INFO  HTTPS_SECRETKEYSIZE = ''
    03/07/2019 10:54:41 INFO  HTTPS_SERVER_ISSUER = ''
    03/07/2019 10:54:41 INFO  HTTPS_SERVER_SUBJECT = ''
    03/07/2019 10:54:41 INFO  id = '50668948'
    03/07/2019 10:54:41 INFO  LLSYSPARAMS_ASSOC = 'A<1,?,''_uploadPath''=''C:\\windows\\TEMP\\''>'
    03/07/2019 10:54:41 INFO  name = 'TESTING Document.docx'
    03/07/2019 10:54:41 INFO  PATH_INFO = '/api/v2/nodes/50668948/versions'
    03/07/2019 10:54:41 INFO  PATH_TRANSLATED = 'C:\inetpub\wwwroot\api\v2\nodes\50668948\versions'
    03/07/2019 10:54:41 INFO  QUERY_STRING = ''
    03/07/2019 10:54:41 INFO  REMOTE_ADDR = '10.0.150.236'
    03/07/2019 10:54:41 INFO  REMOTE_HOST = '10.0.150.236'
    03/07/2019 10:54:41 INFO  REMOTE_USER = ''
    03/07/2019 10:54:41 INFO  REQUEST_ID = '770a3ebf-410a-11e9-85d0-0050562163e0'
    03/07/2019 10:54:41 INFO  REQUEST_METHOD = 'POST'
    03/07/2019 10:54:41 INFO  REQUEST_PROCESSING_DURATION = '0'
    03/07/2019 10:54:41 INFO  SCRIPT_NAME = '/otcs/cs.exe'
    03/07/2019 10:54:41 INFO  SERVER_NAME = 'testdns'
    03/07/2019 10:54:41 INFO  SERVER_PORT = '80'
    03/07/2019 10:54:41 INFO  SERVER_PROTOCOL = 'HTTP/1.1'
    03/07/2019 10:54:41 INFO  SERVER_SOFTWARE = 'Microsoft-IIS/10.0'
    03/07/2019 10:54:41 TRACE KOSValue::Initialize: Cannot default initialize value of type -127, setting to undefined
    
  • Looking at the log, for the first upload you have :

    file_filename = 'file1131425378715884024'

    for the second, add version, you have :

    03/07/2019 10:54:41 INFO file_filename = 'TESTING Document.docx'

    I suspect this may be causing an issue with either the setting of the MIME Type on load or the display of the EDIT button - which may be checking for a known file ext.

    Can you retest using a correct filename and ext in the first case ?

    Also worth reading the OT doc on MIME Type Detection - https://knowledge.opentext.com/knowledge/cs.dll/kcs/kbarticle/view/KB489279

  • The code has been fixed so that the filename field correctly matches the name of the file. However, we are still unable to edit. Here are the logs:

    03/14/2019 11:13:13 TRACE CrackRequestStream: Strict Args from request data length = 28331 type: multipart/form-data;boundary=Boundary_10_978880848_1552587192902.
    03/14/2019 11:13:13 TRACE CrackMultipart: parse POST data with boundary = --Boundary_10_978880848_1552587192902
    03/14/2019 11:13:13 DEBUG KHTTPArgs::GotoNextPart start -- 11:13:13 (15) [212168780685]  28331
    03/14/2019 11:13:13 TRACE KHTTPArgs::FillEmptyReadBuf try to read bytes from client socket istream: 28331
    03/14/2019 11:13:13 DEBUG KHTTPArgs::FillEmptyReadBuf end -- 11:13:13 (390) [212169146568] read 28331 more bytes into buffer.
    03/14/2019 11:13:13 DEBUG KHTTPArgs::ReadMoreUntil end -- 11:13:13 (390) [212169146670]  returned 37 bytes and found the until string.
    03/14/2019 11:13:13 DEBUG KHTTPArgs::GotoNextPart end -- 11:13:13 (390) [212169146720]  28292 part size was: 0
    03/14/2019 11:13:13 INFO  type = 144  11:13:13 (390) [212169146819]
    03/14/2019 11:13:13 INFO  parent_id = 50635975  11:13:13 (390) [212169146871]
    03/14/2019 11:13:13 INFO  name = WordDocument-9-test.docx  11:13:13 (390) [212169146911]
    03/14/2019 11:13:13 WARN  unused form-data key: modification-date
    03/14/2019 11:13:13 WARN  unused form-data key: size
    03/14/2019 11:13:13 INFO  KHTTPArgs::GetNextPart using temporary file: C:\windows\TEMP\otup49A2858D16DE4FC999BD24B56E65A4D10 11:13:13 (390) [212169147540]  
    03/14/2019 11:13:13 DEBUG KHTTPArgs::GotoNextPart start -- 11:13:13 (390) [212169147583]  27723
    03/14/2019 11:13:13 DEBUG KHTTPArgs::ReadMoreUntil end -- 11:13:13 (390) [212169147673]  returned 27719 bytes and found the until string.
    03/14/2019 11:13:13 DEBUG KHTTPArgs::GotoNextPart end -- 11:13:13 (390) [212169147866]  2 part size was: 27680
    03/14/2019 11:13:13 INFO  file_filename = WordDocument-9-test.docx  11:13:13 (390) [212169148153]
    03/14/2019 11:13:13 INFO  file_filelength = 27680  11:13:13 (390) [212169148200]
    03/14/2019 11:13:13 INFO  file_content_type =   11:13:13 (390) [212169148286]
    03/14/2019 11:13:13 INFO  file = C:\windows\TEMP\otup49A2858D16DE4FC999BD24B56E65A4D10  11:13:13 (390) [212169148325]
    03/14/2019 11:13:13 INFO  REQUEST_ID = 'd4c24771-4684-11e9-aa2a-0050562163e0'
    03/14/2019 11:13:13 DEBUG KWSASocket::OpenServiceAsClient() fd = 508
    03/14/2019 11:13:13 DEBUG KWSASocket::OpenServiceAsClient for ai_family 2 socktype 1 ai_protocol 0
    03/14/2019 11:13:13 INFO  KLLClient::OpenConnection connected to server testdns:2099  11:13:13 (390) [212169152244]
    03/14/2019 11:13:13 INFO  Open client SUCCESS  11:13:13 (390) [212169152301]
    03/14/2019 11:13:13 INFO  Sending request to server begin --  11:13:13 (390) [212169152325]
    03/14/2019 11:13:13 TRACE KSocketStream::SubclassFlush...WRITING...bufferSize=3125
    03/14/2019 11:13:13 DEBUG KWSASocket::WriteWithTimeout(): Ignoring a timeout value of zero; socket may block indefinitely.
    03/14/2019 11:13:13 TRACE KSocketStream::SubclassFlush...WRITTEN...retval=3125
    03/14/2019 11:13:13 INFO  Sending request to server end, waiting for response --  11:13:13 (390) [212169152648]
    
  • between each step, what do you see in DVERSDATA for the document ?

  • Here is the DVERSDATA for the WordDocument-9-test.docx document:

    VERSIONID    DOCID   VERSION     VERSIONNAME     OWNER   VERCDATE                   VERMDATE            PLATFORM     FILENAME                   DATASIZE     RESSIZE     FILETYPE    FILECREATOR     FILECDATE                  FILEMDATE           ICON     PROVIDERID      VERCOMMENT      LOCKED      LOCKEDBY    LOCKEDDATE      INDEXED     FINDERFLAGS     MIMETYPE    VERTYPE     VERMAJOR    VERMINOR    GUID                               PAGENUM      TRANSIENT 
    50685228     50685228    1          1           42413633 03/14/2019 11:13 AM     03/14/2019 11:13 AM     2          WordDocument-9-test.docx     27680          ?           docx     ?              03/14/2019 11:13 AM      03/14/2019 11:13 AM     ?          50685228     ?                  0           ?           ?               0           0               ?           ?           0           1       [8412e03026be6067e0534596970a9dd4]   ?              ? 
    

    And after adding a new version this is the result of the DVERS Data:

    VERSIONID    DOCID      VERSION      VERSIONNAME     OWNER          VERCDATE                VERMDATE            PLATFORM     FILENAME                   DATASIZE     RESSIZE     FILETYPE    FILECREATOR     FILECDATE                  FILEMDATE           ICON     PROVIDERID      VERCOMMENT      LOCKED      LOCKEDBY    LOCKEDDATE      INDEXED     FINDERFLAGS     MIMETYPE                                                                   VERTYPE      VERMAJOR    VERMINOR    GUID                               PAGENUM      TRANSIENT 
    50685228     50685228    1              1           42413633     03/14/2019 11:13 AM     03/14/2019 11:13 AM     2          WordDocument-9-test.docx     27680          ?           docx     ?              03/14/2019 11:13 AM      03/14/2019 11:13 AM     ?      50685228            ?               0           ?           ?               0           0               ?                                                                        ?              0            1      [8412e03026be6067e0534596970a9dd4]   ?              ? 
    50685238     50685228    2              2           42413633     03/21/2019 08:26 AM     03/21/2019 08:26 AM     2          WordDocument-9-test.docx     27680          ?           docx     ?              03/21/2019 08:26 AM      03/21/2019 08:26 AM     ?      50685237            ?               0           ?           ?               0           0           application/vnd.openxmlformats-officedocument.wordprocessingml.document      ?              0            2      [8412e03026c76067e0534596970a9dd4]   ?              ? 
    
Sign In or Register to comment.