actionscript 3 - http error 405 with mobile flex application -
i having issue everytime try upload image flex mobile application iis directory , directory configerd web application http error 405 'method not allowed' hence dont use script server side , dont want use ..
and code upload button
protected function getimage(event:event):void { var image:bitmap = bitmap(event.target.content); bitmapdata = image.bitmapdata; byte = jpgencoder.encode(bitmapdata); // bytearray uploadrequest = new urlrequest("http://localhost/problmeimages/"); var header:urlrequestheader = new urlrequestheader("content-type","application/octet-stream"); uploadrequest.requestheaders.push(header); uploadrequest.method = urlrequestmethod.put; uploadrequest.data = byte; urlloader1.dataformat = urlloaderdataformat.binary; urlloader1.addeventlistener(event.complete,uploaded); urlloader1.addeventlistener(httpstatusevent.http_response_status,displayerror); urlloader1.load(uploadrequest); } protected function uploaded(event:event):void { popupmanager.removepopup(alert); errormsg = "done!"; var str:string = urlloader1.data; popupmanager.addpopup(alert,this,true); popupmanager.centerpopup(alert); } protected function displayerror(event:event):void { errormsg = httpresponsemsg; popupmanager.addpopup(alert,this,true); popupmanager.centerpopup(alert); }
Comments
Post a Comment