# Serving local mesh files to babylon

**URL:** <https://forum.babylonjs.com/t/serving-local-mesh-files-to-babylon/10922>\
**Category:** Questions\
**Created:** [May 18, 2020, 5:57am UTC](https://forum.babylonjs.com/t/serving-local-mesh-files-to-babylon/10922 "2020-05-18T05:57:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HEAD](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@HEAD](https://forum.babylonjs.com/u/HEAD)\
**Post date:** [May 18, 2020, 5:57am UTC](https://forum.babylonjs.com/t/serving-local-mesh-files-to-babylon/10922/1 "2020-05-18T05:57:12Z")

</div>

Hi there,  
I’m trying to get this webapp running where users can load/drag-drop meshes (stl and obj) from their hard drive onto the babylon canvas and get a 3D-preview with some added functionality.

After trying:  
BABYLON.SceneLoader.ImportMesh(“”, “localMesh.obj”, “”, scene, function(newMeshes) {});  
and getting:  
“Access to XMLHttpRequest at ‘file:///…’ from origin ‘null’ has been blocked by CORS policy”

And reading through this thread:

> [@How to import geometry that I have already prepared](https://forum.babylonjs.com/t/how-to-import-geometry-that-i-have-already-prepared/1155/38):
>
> Could you send me ready code and files that works on your PC, I will try it on my, and it will help me to figure out what I`m doing wrong…!?

Apparently for security reasons the browser can not directly acess files on the local drive.  
I don’t know if this is correct since I don’t have much frontend experience.

It left me wondering how websites like [shapeways.com](http://shapeways.com) and others handle those file imports.  
Do they send the meshes to a server first for processing and then serve the response from the server back to the user?  
How do they do that if the website can’t access local data?

Thanks for helping out if these questions are too basic. Really appreciate it  
-S

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [May 18, 2020, 7:38am UTC](https://forum.babylonjs.com/t/serving-local-mesh-files-to-babylon/10922/2 "2020-05-18T07:38:18Z")

</div>

Hi @HEAD and welcome to the forum. You need to run your webapp through a local server. You can install Node.js (which installs npm) and then the ws package [ws - npm](https://www.npmjs.com/package/ws).

Other local servers are available.
