08-11-2017 09:35 AM
Hi all,
I m using Alfresco Community 5.2. I have some problems about uploading same named documents.
For example, I have a document called "test.doc". If a file with the same name is uploaded into the same area, Alfresco created another file "test-1.doc" by default.
Could give an error message instead (like - document already exist -)? Is this possible?
Please help me..
Thanks in advance
08-11-2017 09:56 AM
That is quite a detail of the default Share user interface, and it is not something that provides a simple configuration to switch. There is also some logic involved to determine if the name should be adapted or not. To prevent the renaming you'd have to make sure that the "showConfig.updateFilename" setting is never set to "true". Since the showConfig is usually provided from the code to trigger the upload, you might have to check/change in multiple sources (including 3rd-party addons that might provide a custom upload action/UI) to check that every instance is configured to your preference.
Alternatively, you'd have to override the default upload web script to eliminate the code that handles the rename.
08-11-2017 10:34 AM
Hi, thanks for your answer.
I changed scope.showConfig.updateFilename as false in dnd-upload.js file. But nothing changed in my documents. I m giving my added line on code in dnd-upload.js file. How can I do ?
....
...
...
var fileName = file.name,
updateNameAndMimetype = false;
scope.showConfig.updateFilename = false; //I added this line
if (!!scope.showConfig.newVersion && scope.showConfig.updateFilename && scope.showConfig.updateFilename !== fileName)
{
updateNameAndMimetype = true;
}
...
...
...
Explore our Alfresco products with the links below. Use labels to filter content by product module.