I have a simple file browser that allows a user to select a local image, I want to manipulate this image before uploading to the server. The problem I'm having is that when I call fileReference.upload() it seems to upload the original file on the user's hard drive rather than the modified bytearray. Am I doing something wrong, is this expected behaviour or a bug?
As a very basic test if I do something like this I still get the original file:
// load the file in to memory
_fileReference.load();
// ... on file reference loaded
trace(_fileReference.data.length); // 230189
_fileReference.data.clear();
trace(_fileReference.data.length); // 0
// With this next line commented out I would expect a 0 bytes file, or an error or something, but instead it happily uploads the original file.
//_fileReference.data.writeBytes(myNewByteArray);
_fileReference.upload(myURLRequest);
According to this post Manipulate file data (byte array) this should work...
Any thoughts greatly appreciated!
Cheers, Simon