Check only for file sizes of 0 and 4096

[ci skip]

https://community.openproject.com/wp/30450
pull/7434/head
Oliver Günther 5 years ago
parent 933b3370b2
commit e1ff36eb54
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 4
      frontend/src/app/modules/attachments/attachments-upload/attachments-upload.component.ts

@ -156,8 +156,8 @@ export class AttachmentsUploadComponent implements OnInit {
}
// Files however MAY have no mime type as well
// so fall back to checking zero or multitudes of 4096:
if ((file.size % 4096) === 0) {
// so fall back to checking zero or 4096 bytes
if (file.size === 0 || file.size === 4096) {
console.warn(`Skipping file because of file size (${file.size}) %O`, file);
return false;
}

Loading…
Cancel
Save