We help IT Professionals succeed at work.
Get Started

How can Flash write to a password protected XML file?

Last Modified: 2013-11-19
I have my flash setup so that it stores information in an XML file. It grabs the current XML file and then appends the new data to the end of the XML file. It does this by using the short PHP file below:

//    $xml = xmldoc($GLOBALS["HTTP_RAW_POST_DATA"]);
    $file = fopen("data.xml","wb");
    fwrite($file, $xml);
//    echo("<status>File saved.</status>");

The problem is that I want to make it so people can't just go and grab the data.xml file. How do I protect the data.xml file so that no one can access it unless it is accessed via the Flash?

I have tried messing with some .htaccess settings but can't seem to get it to work. I was thinking I could create some kind of .htaccess setting so that the data.xml file would be password protected and only the swf and php file could have access to it. Is that possible? Is there a better way?

Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE