A: 

Is there any reason you're using the HTTP_RAW_POST_DATA? If Flash is sending the file via the POST method, it'd be by far easier to use the $_FILES array. There'd be no need to fopen/fwrite, as the file's already been stuck into a temp dir by PHP. All you have to do is use [move_uploaded_file()][1] to put it wherever you want on the server.

Marc B
jolyonruss
That's exactly how it works. `move_uploaded_file(source, destination)`, in your case it'd be `move_uploaded_file($_FILES['nameofuploadfield']['tmp_name'], '/some/directory/on/the/server/name_of_file.html')`
Marc B
I'm pretty curtain I've worked out what the problem is, the clients host is a crappy shared affair and the "max_input_time" in the php.ini is set to -1
jolyonruss