Full document path displayed on document upload...

Options

When posting/uploading a document to Content Server using REST API, we've noticed that under the properties on the version tab the uploaded file contain the full path of the original document location as a 'File Name' (i.e. C:\Users\UserName\Desktop\SomeFolder\NameofDoc.docx ) instead of the name, only.

It's worth mentioning that this only occurs when uploading files using IE not Chorme.

Below is the code that handles the upload:

function upload( files,i ) {

var bodyData = {
    type: 144,
    parent_id: 1010101,         // parent ID
    name: files[i].name,
    roles: {
    categories: {
        {
        "1234567": {            // category
            "1234567_2": "test"     // attribute
            }
        }
    }
    }
},

formData = new FormData();
formData.append( "body", JSON.stringify( bodyData ) );
formData.append( "file", files[i] );

return $.ajax( {
type: "POST",
url: ".../api/v1/nodes",
data: formData,
headers: { otcsticket: otcsticket }
}).then( function ( response ) {
    ... succeeded
}, function ( jqxhr ) {
    ... failed
});

}

Would any one know how to avoid this issue or whether there is a patch to hide the document path?

Thanks in advance for all your help.

Alban

Comments

  • This is a problem specific to IE11. Other browsers pass just the file name to the request body, when the document creation form is posted.

    There will be a workaround built to CS - trimming the path, when the request is received on the server side. It should be released with the June or September updates.

    If you needed to fix it right now, you could install HTTP server, which would work like a request-parsing proxy, detect document creation requests and modify the part containing the file name.

  • Hi Ferdinand,

    Thanks for your reply.

    Just a quick question, would this workaround be releases as an individual patch or as a cumulative one?

    Many thanks,
    Alban

  • It will be a part of the next quarterly cumulative update. Either 2016.06 or 2016.09; I'm not sure.