you can edit xml files using flash.
Please read the question before answer! Thanks!
is this clear enough for you to understand:
your orignal post is incorrect. you can load an xml log, update/edit it in flash and resave it with some server-side scripting.
Yes, I do understand you can do that, however, what happens if two or more people are downloading, and attempt to write the XML file back! Some data is going to be lost. Do you understand now?
To make this clearer,
Person A decide to download a file, and the site reads the XML to the client machine.
Person B decides to download a file at that same time and reads the XML file.
Person A writes the XML back to the server and with the new information in it.
Person B writes the XML back.
Oops! XML on persons B machine doesn't have the information from persons A XML so therefore lost.
Again thank you for the reply.
OK! This is my theory to solving this problem I have.
I'll have two xml files, the first being the log itself, the second we can call a lock file also xml.
The lock file consists of:
<file lock="false" />
When a person clicks to download a file, the swf downloads the lock file and checks to see if the lock property is false, if it is then it is set to true and sent back, then it can freely download and modify the log, then the lock file is set to false and sent back.
If on the other hand the lock property is true, it'll wait an amount of time before loading the lock file again, until the lock file says it is OK to load the XML log.
I'll do some tests over then next few days and keep you posted.
Just thought of an even better way of doing it! Which solves the multi-access to a single file problem.
Having not a single log file but one for each user IP, in other words, have a seperate log file for each computer that logs in.
If I save the XML as the users IP address and then there is no problem as no one else will have that IP address.
OK! Problem solved.