I am attempting to export query results to an XLS file. My parsing logic works, but I can't write it out to a file. Here is my code I've been testing, which doesn't do anything - the file remains blank.
var urlExcelExport:String = "file:///c:/test.txt"; //also tried "C:\\export.txt"; "C:\\excelexport.cfm"; for urlExcelExport
var request:URLRequest = new URLRequest(urlExcelExport);
request.contentType = "text/txt";
request.method = URLRequestMethod.POST;
request.data = "testing!";
var loader:URLLoader;
try {
loader = new URLLoader();
loader.load(request);
}
catch (error:IOError) {
trace("error="+error.message);
}
catch (error:Error) {
trace("Unable to load requested document.");
}
Does anyone have a simple example of writing data out to a file? Thank you!