PDA

Click to See Complete Forum and Search --> : writing xml from flash



fpanko
06-05-2001, 03:06 PM
hey there,
i know you can read and create xml documents in flash, but is there a way to save a xml document that flash creates onto the server?? Would I need php, or cgi??
thanks

capcards
06-07-2001, 03:21 PM
I found this link today but can't figure out how to get it to work.

http://html.about.com/compute/html/gi/dynamic/offsite.htm?site=http%3A%2F%2Fwww.fastnetltd.ndire ct.co.uk%2FPerl%2FXMLForm.html

fpanko
06-07-2001, 03:45 PM
thanks for the link. I guess this one does it with perl script. I'm not very proficient in perl. I imagine one could just dump the perl into ones cgi-bin and then call it using post. Not sure how this would work when coming from flash. I wonder if there is an easier way with php.

StuartW
06-14-2001, 08:08 PM
There is a way to get php to do it...

something like:



copy($filename, "data/$name.xml");


You have to make sure you set the right permissions on the folder that the pages are saved into.

$filename is your xml document and $name is the name you want to save it as.

Of course you might want to check if it worked:



if (copy($filename, "data/$name.txt")) {
echo ("ALRIGHT! File created.");
} else {
echo ("DOH! File did not copy.");
}


Hope this helps a bit.

Stu

fpanko
06-14-2001, 10:58 PM
you da man stu!
I'm just starting to learn php and that was the next thing i wanted to get into. :)
thanks

bebopcoder
07-16-2001, 04:17 PM
Wouldn't you already have to have the XML file stored somewhere on the server ? What if you want to store one that flash just created. You'd have to take all the data and dump it into an xml document. And THEN copy the file to wherever for storage. My question is, how did you originally get the xml passed from flash ? What variable(s) is it stored in ?

--BEBOPCODER

tupps
07-16-2001, 07:31 PM
The XML from flash is the entire Post data. It is not passed in as a single variable as though it was being submitted from a form.

Basically if you are using Perl to download the info you don't use the name/value splitting routine you should be able ot just dump the enitre query string to the server.

Thanks

Luke

bebopcoder
07-16-2001, 10:09 PM
And in PHP ? Where are the variables stored in PHP ? $QUERY_STRING ?

tupps
07-16-2001, 10:40 PM
its no documented in PHP properly but there is:

$GLOBALS["HTTP_RAW_POST_DATA"]

Which as the name saw returns you the raw post data.

Thanks

Luke

bebopcoder
07-17-2001, 03:51 PM
Check this link out (it has some answers relevant to this thread):

http://www.actionscripts.org/forums/showthread.php3?postid=13013#post13013




Originally posted by tupps
its no documented in PHP properly but there is:

$GLOBALS["HTTP_RAW_POST_DATA"]

Which as the name saw returns you the raw post data.

Thanks

Luke