Hello, i want to import a File with the BABYLON.SceneLoader.ImportMesh, but i don't have a URL, because the file comes form a Form. i have input form:
<html>
...
<input type="file" id="upload_file" name="upload" />
...
</html> and i try to import my Mesh (.babylon-File) out of the form, without uploading it. But i don't know how to import a file without a given URL. Please Help me :-)
<script>...
var inputElement = document.getElementById("upload_file");
inputElement.addEventListener("change", function handleFiles(event) {
var fileList = this.files[0];
// The first parameter can be used to specify which mesh to import. Here we import all meshes
BABYLON.SceneLoader.ImportMesh("", "", "data:" + fileList, scene, function (newMeshes) {
// Set the target of the camera to the first imported mesh
camera.target = newMeshes[0];
});
}, false); ... </scrip> Thanks!