Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 52s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 52s
This commit is contained in:
commit
f4a2993a32
1 changed files with 3 additions and 3 deletions
|
|
@ -180,14 +180,14 @@ export class DocumentController extends Controller {
|
|||
|
||||
let fileList = !body.replace
|
||||
? body.fileList.map(({ fileName, ...props }) => {
|
||||
if(fileName.length > 85){
|
||||
throw new Error("ไม่สามารถอัปโหลดไฟล์ได้ เนื่องจากชื่อไฟล์มีความยาวเกินที่ระบบกำหนด กรุณาปรับชื่อไฟล์ให้สั้นลง");
|
||||
}
|
||||
const dotIndex = fileName.lastIndexOf(".");
|
||||
let originalName =
|
||||
dotIndex !== -1 && !fileName.startsWith(".") ? fileName.slice(0, dotIndex) : fileName;
|
||||
const extension =
|
||||
dotIndex !== -1 && !fileName.startsWith(".") ? fileName.slice(dotIndex) : "";
|
||||
if([...originalName].length > 95){
|
||||
originalName = [...originalName].slice(0, 95).join('');
|
||||
}
|
||||
let i = 1;
|
||||
while (list.findIndex((v) => v.fileName === fileName) !== -1 || used.includes(fileName)) {
|
||||
fileName = `${originalName} (${i++})`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue