Flex rookie here...

Trying to read/change/write a text file on the server.

Why doesn't this file save work?

I'm able to use the URLRequest/URLLoader to read the file, but want 
to write changes back to the file.

I get the "File saved" message but the file is not updated.

Thanks 

//save the file 
request = new URLRequest("C:\\temp.txt");
request.method = URLRequestMethod.POST; 
request.data = changedData;

loader = new URLLoader();
                loader.addEventListener(Event.COMPLETE, 
saveComplete);   
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);   

try {
        loader.load(request);  
}
catch (e:Error){
        Alert.show("Error in loader.load" + e.message);
}

  }

private function saveComplete(event:Event):void {   
Alert.show("File saved"); 
}                 

Reply via email to