private var fileRef:FileReference
private function doCreationComplete():void
{
fileRef= new FileReference();
fileRef.addEventListener(Event.COMPLETE, completeHandler);
fileRef.addEventListener(ProgressEvent.PROGRESS, fileRef_progress);
fileRef.addEventListener(Event.SELECT, doSelect );
}
public function doBrowse( event:Event ):void
{
try
{
fileRef.browse();
}
catch (error:Error)
{
trace("Unable to browse for files.");
}
}
public function doSelect( event:Event ):void
{
txtPhoto.text = fileRef.name;
}
public function doSubmit( event:Event ):void
{
var request:URLRequest = new URLRequest( "http://localhost:8080/JustSms/com/contacts/serviceImpl/CSVReader" );
var vars:URLVariables = new URLVariables();
vars.person = txtPerson.text;
request.data = vars;
fileRef.upload( request );
}
function completeHandler(event:Event):void
{
trace("uploaded");
}
private function fileRef_progress(evt:ProgressEvent):void
{
progressBar.visible = true;
}
错误#2044:未处理的IOErrorEvent:。 text =错误#2038:文件I / O错误。 在uploadcontacts / doCreationComplete()[D:\ Flexspace \ SMS \ src \ uploadcontacts.mxml:17] at uploadcontacts / ___ TitleWindow1_creationComplete()[D:\ Flexspace \ SMS \ src \ uploadcontacts.mxml:3] at flash.events::EventDispatcher/dispatchEventFunction()
这是什么错误?我怎么能处理这个...并且这是对Requet Servltet的正确方法吗?请帮助我..