Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cophilot committed Jan 23, 2024
1 parent 574cdf3 commit fd7b6d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/app/user-input/add-file/add-file.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@ export class AddFileComponent {
const file = event.target.files[0];
const reader = new FileReader();
reader.readAsText(file);

// read the content of the file
if (file.name.includes('(') || file.name.includes(')')) {
NotificationComponent.showNotification(
'Error uploading file',
'File name cannot contain "(" or ")"',
5000,
true
);
return;
}
reader.onload = () => {
// convert it to base64

this.apiService
.uploadFile(
file.name,
Expand Down

0 comments on commit fd7b6d0

Please sign in to comment.