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.");
} private function exportTo(event:Event):void
{
try
{
var data:String;
var defaultFileName:String;
if(optiongroup.selectedValue == _exp2csvBtnLbl){
data = exportCSV(resultsGrid,_csvSep);
defaultFileName = _csvName + ".csv";
}else{
data = exportTXT(resultsGrid);
defaultFileName = _csvName + ".txt";
}
var fileReference:FileReference = new FileReference();
fileReference.save(data,defaultFileName);
}
catch(error:Error)
{
Alert.show(error.message);
}
}