Resizing FileReference image then reuploading, only reuploads original image.
- by pfunc
I can;t figure out how to do this. Someone selects and image after calling FileReference.browse(). I take that image and make a thumbnail in flash.
Then I upload that image like so:
var newFileReq:URLRequest = new URLRequest(FILE_UPLOAD_TEMP);
newFileReq.contentType = "application/octet-stream";
var fileReqVars:URLVariables = new URLVariables();
fileReqVars.image = myThumbImage;
fileReqVars.folder = "Thumbs";
newFileReq.data = fileReqVars;
newFileReq.method = URLRequestMethod.POST;
//upload the first image
fileRef.addEventListener(Event.COMPLETE, onFirstFileUp);
fileRef.upload(newFileReq, "Filedata");
All this does it upload the original image. How do I change the fileRef to upload the new thumb? I have traced out the size of the "myThumbImage" and it is correct. I have placed it visually on the stage after creating the thumb, and it seems like it works. But when I upload it to an aspx page (that basically just throws it into a folder), it uploads the original larger image.