create original file name from new document name when uploading document from the library folder.

This commit is contained in:
Uwe Steinmann 2022-09-07 09:26:27 +02:00
parent 04ce8ea28f
commit e76df4c71f
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,8 @@
--------------------------------------------------------------------------------
- merge changes up to 5.1.27
- fix triggering workflow (Closes: #542)
- create original file name from new document name when uploading document
from the library folder. Used to be the original file name
--------------------------------------------------------------------------------
Changes in version 6.0.19

View File

@ -367,10 +367,15 @@ if($settings->_libraryFolder) {
$docsource = 'library';
$fullfile = tempnam(sys_get_temp_dir(), '');
if(SeedDMS_Core_File::copyFile($dms->contentDir . $content->getPath(), $fullfile)) {
if($_POST["name"]!="") {
$oext = pathinfo($content->getOriginalFileName(), PATHINFO_EXTENSION);
$origfilename = getFilenameByDocname(trim($_POST['name'])).".".$oext;
} else
$origfilename = $content->getOriginalFileName();
$file_ary[] = array(
'tmp_name' => $fullfile,
'type' => $content->getMimeType(),
'name' => $content->getOriginalFileName(),
'name' => $origfilename,
'size' => $content->getFileSize(),
'error' => 0,
'source' => 'library',