Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-01-2010, 08:55 AM   #1
Join Date: Apr 2009
Posts: 58
Default Error #2048: Security sandbox violation


Before I start, I have read this thread:

But I think my problem is a bit different:

I have a flash file, that sends data to a php script. This script then saves a jpg on the server.

PHP Code:

$absolutepath = dirname(__FILE__);

if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) 
	$filename = $_GET['name'];
else echo 'An error occured.';
AS Code

var serverPath:String = "";

function createJPG(fileName:String="snapshot.jpg")
	var jpgSource:BitmapData = new BitmapData (600,600);
	var jpgEncoder:JPGEncoder = new JPGEncoder(100);
	var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
	var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");
	var jpgURLRequest:URLRequest = new URLRequest (serverPath+"jpg_encoder.php?name=" + fileName);		
	jpgURLRequest.method = URLRequestMethod.POST;				
	jpgURLRequest.data = jpgStream;
	var jpgURLLoader:URLLoader = new URLLoader();
	//jpgURLLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
	jpgURLLoader.load( jpgURLRequest );
Both the php and the swf file is located in /my_project/public/actionscript/

I am using WampServer and when I run it through localhost, everything works fine and the php writes the file. However, if I put WampServer online, and access my project through the network, flash gives me this error: is the localhost IP.

Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: cannot load data from
at test_fla::MainTimeline/createJPG().

Could you please help me and give me some advice? Does this have something to do with the crossdomain.xml file from the other thread. Or is it WampServer that is preventing me from writing files?

vdLoo88 is offline   Reply With Quote
Old 06-01-2010, 09:52 AM   #2
Senior Member
henke37's Avatar
Join Date: Mar 2009
Location: Sweden
Posts: 11,061
Send a message via Skype™ to henke37

The ip addresses differ. Make them not do that.
Signature: I wrote a pair of articles about the timeline.
henke37 is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:19 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.