# Load a local server file?

**URL:** <https://forum.kirupa.com/t/load-a-local-server-file/248450>\
**Category:** Uncategorized\
**Created:** [January 8, 2008, 10:05am UTC](https://forum.kirupa.com/t/load-a-local-server-file/248450 "2008-01-08T10:05:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoulz](https://avatars.discourse-cdn.com/v4/letter/z/dfb087/32.png) [@Zoulz](https://forum.kirupa.com/u/Zoulz)\
**Post date:** [January 8, 2008, 10:05am UTC](https://forum.kirupa.com/t/load-a-local-server-file/248450/1 "2008-01-08T10:05:06Z")

</div>

Hello, i’m totally confused about flash security. My goal is to stream a mp3 from my server’s local filesystem (which is not available from the web). I’ve tried using NetStream, but when I run the compiled swf off my server in a browser I get a security message:

**2148** SWF file \_ cannot access local resource \_. Only local-with-filesystem and trusted local SWF files may access local resources.

```auto

private var musicURL : String = "file:///home/vermin/music/test.mp3";

connection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
connection.connect(null);

private function netStatusHandler(event : NetStatusEvent) : void
{
    switch(event.info.code)
    {
        case "NetConnection.Connect.Success":
            connectStream();
            break;
    }
}

private function connectStream() : void
{
    stream = new NetStream(connection);
    stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    stream.client = new CustomClient();
    stream.play(musicURL);
}

```
