I have a Flex app that I'm trying to add "file preview" functionality to. I have a LinkButton in Flex that, when clicked, should open the file in a new browser window. I found a helpful actionscript class that properly formats the POST data to pass the file to an HTML page. The files I want to preview are being stored in the database, and I'm passing the through the POST data as a ByteArray. The file POST data is put into a URLRequest, which is sent to the HTML page through a URLLoader.
Here's what my POST request looks like:
Content-Disposition: form-data; name="Filename"
Content-Disposition: form-data; name="Filedata"; filename="arrows.png"
"image information as ByteArray"
Content-Disposition: form-data; name="Upload"