views:

1184

answers:

2

Hi,

I'm trying to do an http post from flash on my website to a method in a controller (My site is on Asp.Net MVC) and I'm getting this error:

Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://www.mysite.com/Home/DoSomething at Main/postToMyWebsite()

Any ideas of why these errors happen and how to prevent them?

Please let me know if you require any more info

Thanks,
Matt

A: 

Please check this link

http://curtismorley.com/2008/02/08/actionscript-error-2032/

These types of error you can expect when the wrong URL is used!!!!.

funkydokta
I've read that post. What if I know it's the right url... any ideas?I thought it might have something to do with the fact that it's asp.net mvc, is there any specific way you need to have the url to do a post to an mvc method?
Matt
A: 

Does your POST work, if made from a standard HTML form? If not, I wouldn't expect it to work in Flash, so you'll have to check your ASP code.

Does the ASP page echo anything? You could be getting an error if there are no headers or no output at all from that page. Try to output something.

Also, it might help to listen to the httpStatus events. That might give you some insight on what's going on. To add a httpStatus listener, you do something like:

myUrlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
private function httpStatusHandler(event:HTTPStatusEvent):void {
    trace("HTTP status recieved: " + event.status);
}

Please post the code if none of theese work. It's quite hard to guess what could be going on there..

evilpenguin