Skip to content

Commit c7e58e1

Browse files
committed
Add some more possible mime types for sprite files
1 parent b561926 commit c7e58e1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/lib/file-uploader.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ const soundUpload = function (fileData, fileType, storage, handleSound, handleEr
238238
const spriteUpload = function (fileData, fileType, spriteName, vm, handleSprite, handleError = () => {}) {
239239
switch (fileType) {
240240
case '':
241+
// scratch-vm specifies application/x.scratch.sprite3 for sprite3 files. Real packages in the
242+
// wild use hyphens instead of periods. We'll just support all of the reasonable variations.
243+
case 'application/x-scratch2-sprite':
244+
case 'application/x-scratch3-sprite':
245+
case 'application/x.scratch2.sprite':
246+
case 'application/x.scratch3.sprite':
241247
case 'application/zip': { // We think this is a .sprite2 or .sprite3 file
242248
handleSprite(new Uint8Array(fileData));
243249
return;

0 commit comments

Comments
 (0)