Created
June 6, 2012 07:21
-
-
Save wwwins/2880407 to your computer and use it in GitHub Desktop.
upload image use application/octet-stream header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jpgencoder:JPGEncoder = new JPGEncoder(80); | |
var ba:ByteArray = jpgencoder.encode(Bitmap(_arrPhotos[0].photo).bitmapData); | |
var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream"); | |
var request:URLRequest = new URLRequest("http://api.wwwins.com.tw/saveImg.php?category=" + arrSwitchBtnValue[indexSwitch]); | |
var loader:URLLoader = new URLLoader(); | |
request.requestHeaders.push(header); | |
request.method = URLRequestMethod.POST; | |
request.data = ba; | |
loader.load(request); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment