fix: handled attachment upload filename size error in the issue detail (#3485)

* fix: handled attachment upload filename size error in the issue detail

* ui: profile detail sidebar border
This commit is contained in:
guru_sainath 2024-01-28 18:30:53 +05:30 committed by GitHub
parent 212f2b54f8
commit 532da80375
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 42 additions and 19 deletions

View file

@ -1,3 +1,14 @@
export const generateFileName = (fileName: string) => {
const date = new Date();
const timestamp = date.getTime();
const _fileName = getFileName(fileName);
const nameWithoutExtension = _fileName.length > 80 ? _fileName.substring(0, 80) : _fileName;
const extension = getFileExtension(fileName);
return `${nameWithoutExtension}-${timestamp}.${extension}`;
};
export const getFileExtension = (filename: string) => filename.slice(((filename.lastIndexOf(".") - 1) >>> 0) + 2);
export const getFileName = (fileName: string) => {