the loadVariables ("url" ,level/"target" [, variables]) method in Actionscript can be used to pull information from environmental variables. I'm not sure if Flash could handle binary information like a .jpg file with this method, but i imagine you could use this to save information to a file and pass the filename to the script with loadVariables.
Flash has native XML handling in the latest version, look at the XML object that provides XML.send, XML.load, and XML.sendAndLoad methods, I've never used that feature, but I imagine there are examples on the net on the proper way to send XML over HTTP in flash.