AssetManager addMeshTask fails with certain filenames

I noticed some of my GLB files did not load using assetmanager mesh task. After converting the filename to lowercase it works. E.g.

(‘file’ is dropded/selected file)

var blob = new Blob([file]);
assetsManager.addMeshTask(‘meshloader’, ‘’, ‘file:’, file.name);
BABYLON.FilesInput.FilesToLoad[file.name] = blob;
assetsManager.load();
→ Task error when file is like “Ball.glb”

FIX:

var blob = new Blob([file]);
var fkey = file.name.toLowerCase()
assetsManager.addMeshTask(‘meshloader’, ‘’, ‘’, fkey);
BABYLON.FilesInput.FilesToLoad[fkey] = blob;
assetsManager.load();
→ ALL GOOD, same file as previous

What is the best approach here? URLEncode the filename or so, is lowercase sufficient?

Related:

I think this might work as well ???

var blob = new Blob([file]);
var fkey = file.name.toLowerCase()
assetsManager.addMeshTask(‘meshloader’, ‘’, ‘’, file.name);
BABYLON.FilesInput.FilesToLoad[fkey] = blob;
assetsManager.load();

FilesInput.FilesToLoad is normally not meant to be used by the user directly and we do internally move everything to lower case when added into it.

1 Like

Yes that works ! So lowercase is the only conversion necessary. thank you!