Skip to content

Commit 670f4b0

Browse files
authored
Change attachments filename boundaries
I changed the addAttachment method on SPService to do not exclude "&" and "-" characters from filename
1 parent 5fc3a09 commit 670f4b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/SPService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default class SPService implements ISPService {
127127
public async addAttachment(listId: string, itemId: number, fileName: string, file: File, webUrl?: string): Promise<void> {
128128
try {
129129
// Remove special characters in FileName
130-
fileName = fileName.replace(/[^\.\w\s]/gi, '');
130+
fileName = fileName.replace(/[^\.\w\s\&\-]/gi, '');
131131
// Check if attachment exists
132132
const fileExists = await this.checkAttachmentExists(listId, itemId, fileName, webUrl);
133133
// Delete attachment if it exists

0 commit comments

Comments
 (0)