I am trying to load an STL file from a File
object obtained from the .files
property of an <input type="file">
tag. The problem is that the data is not loaded from the file and the loader issues an HTTP request for a file with the same name.
Looking at the sceneLoader.ts
source code it seems that what I want is the directLoad but the check (around line 393) looks for "data:"
in the file name (this is obviously not the case for an File
object).
I suppose I have two questions:
-
Is it right to pass a
File
object and expecting that data will get loaded from there without network access? -
Should I just extract the
File
data into adata:
URL and pass it as the file name?