Skip to content

Commit

Permalink
fix: add accepted Numbas file types
Browse files Browse the repository at this point in the history
  • Loading branch information
satikaj committed Apr 26, 2024
1 parent 8ced7cb commit bb9b660
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export class TaskDefinitionNumbasComponent {
}

public uploadNumbasTest(files: FileList) {
const validFiles = Array.from(files as ArrayLike<File>).filter((f) => f.type === 'application/zip');
console.log(Array.from(files).map(f => f.type));
const validMimeTypes = ['application/zip', 'application/x-zip-compressed', 'multipart/x-zip'];
const validFiles = Array.from(files as ArrayLike<File>).filter(f => validMimeTypes.includes(f.type));
if (validFiles.length > 0) {
const file = validFiles[0];
this.taskDefinitionService.uploadNumbasData(this.taskDefinition, file).subscribe({
Expand Down

0 comments on commit bb9b660

Please sign in to comment.