Search the Community
Showing results for tags 'filereader'.
-
I'm trying to read data from the file as follows and send data to the client. I can send a 20MB file in 30 seconds. But I have to send 20MB per second. Am I doing something wrong? [Server.js] var File = require('File') var FileReader = require('filereader'), fileReader = new FileReader(); fileReader.setNodeChunkedEncoding(true || false); fileReader.readAsArrayBuffer(new File('../Test.txt')); fileReader.addEventListener('load', function (ev) { JsonData = JSON.stringify(new Int16Array(ev.target.result);); }); var app = require('express')(); var http = require('http').createServer(app); var io = require('socket.io')(http); io.on('connection', function(socket){ console.log('a user connected'); console.log("DateTime : " + getDateTime()); socket.on("update", function(data){ console.log("DateTime : " + getDateTime()); socket.send(JsonData); }); socket.send(JsonData); socket.on('message', function(msg){ console.log('message: ' + msg); }); socket.on('disconnect', function(){ console.log('user disconnected'); }); }); http.listen(9099, function(){ console.log('listening on *:9099'); }); [Client.js] var socket = io("http://localhost:9099"); socket.on('message', function(message) { var JsonData = JSON.parse(message); socket.emit("update", { data:"getData"}); }); Socket.io version : 2.2.0 Filereader version: 0.10.3 NodeJS version: 10.16.3
-
- filereader
- socketio
-
(and 1 more)
Tagged with:
-
I am getting the following errors when calling ImportMesh. BJS - [14:34:00]: Unable to import meshes from data:# Blender v2.79 (sub 0) OBJ File: '' : importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse I am using beta 1 version of Babylon and loaders because of babylonjs.loaders.module.d.ts with 3.2.0-beta.3 reported Following code give me the error import * as BABYLON from 'babylonjs'; import 'babylonjs-loaders'; uploadSaveFiles(files: File[]) { files.map((file, i) => { let reader = new FileReader(); if (isImage(file)) { reader.readAsDataURL(file); } else if (isObj(file)) { reader.readAsText(file); } else if (isMtl(file)) { reader.readAsText(file); } else { console.log("File not supported!"); } let data = reader.result; if( isObj(file)) { BABYLON.SceneLoader.ImportMesh("", "", 'data:' + data, scene, function (meshes: BABYLON.AbstractMesh[]) { meshes.forEach((mesh) => { console.log(mesh); }); }); } } } I am trying to load a Obj file from disk. The obj file has accompanying mtl and images files. I currently have a interface where the user drags and drops all appropriate files. Not sure if this is the best way. Do the accompanying files need to be in uploaded first before I can load obj file? If there is a better way to upload obj and material files let me know Thanks
-
Hi everyone, I'm Babylon newbie Problem just as Topic, I have tried importMesh like this: but I can't find where should I upload texture or which fileread type should I get. Thx for help I think my question is not clear, I upload .babylon and its texture at same time. but it comes [Error while trying to load texture] So I was wonder where should I put after load texture to let ImportMesh(method) get,What kind of type should I load (readAsText?readAsDataURL?),how to let ImportMesh to know the textures I upload?
- 2 replies
-
- importmesh
- texture
-
(and 1 more)
Tagged with: