Flex FileReference and ByteArray Compress

880 Views Asked by At

I have a FileReference that is being uploaded. But before upload, I call the compress() method on the ByteArray of the FileReference i.e. fileReference.data.compress().

But I observe that the uploaded file is the raw file and not the compressed file.

Is this a Flex bug or expected behavior? The data field in the FileReference is read-only. Does that come into play?

-- Sri

1

There are 1 best solutions below

5
On BEST ANSWER

Yes. That comes into play. You would have to load a non-FileReference ByteArray in memory, compress it and then send it as a simple multipart-formdata upload. Or in other words, you would have to do what FileReference does for free to add gzip compression support