Wtf, trying to resize bitmap.. not working?

Hey everyone. I have been having issues with a program and realized the thumbnails I thought I was creating were actually full sized. Whats wrong with this code? Thanks.


import com.adobe.images.JPGEncoder;
var m:MovieClip = mcTest;

var jpgSource:BitmapData = new BitmapData (m.width, m.height, false, 0xFFFFFF);
jpgSource.draw(m);
    
var bitmapToScale:Bitmap = new Bitmap(jpgSource);
bitmapToScale.smoothing=true;
    
bitmapToScale.width = 100;
bitmapToScale.scaleY = bitmapToScale.scaleX;        
    
var jpgEncoder:JPGEncoder = new JPGEncoder(80);
var jpgStream:ByteArray = jpgEncoder.encode(bitmapToScale.bitmapData);    
var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");
var jpgURLRequest:URLRequest = new URLRequest ("http://myhandler/myfile.jpg");        
jpgURLRequest.requestHeaders.push(header);                
jpgURLRequest.method = URLRequestMethod.POST;                
jpgURLRequest.data = jpgStream;
    
var jpgURLLoader:URLLoader = new URLLoader();
jpgURLLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
jpgURLLoader.addEventListener( Event.COMPLETE, imageUrlLoaderComplete );
jpgURLLoader.load( jpgURLRequest );
    
function imageUrlLoaderComplete(evt:Event){
    trace("done");
}