I'm trying to add "file preview" functionality to my Flex app. 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 file POST data is put into a URLRequest, which is sent to the HTML page through a URLLoader.
My problem is that I'm not very experienced with Javascript and I don't know how to tell the HTML page to display the file being sent by the Flex app. After countless web searches, I decided to ask here. I'm not asking for anyone to write the code for me, I just need a good place to start from (a keyword, a javascript function to read about, something).
I would like to use a combination of HTML and Javascript to take the POST data and open the included file in the browser.
Other important information: the file needs to be displayed in IE8 and the files being displayed are mostly image files, PDFs, or Word docs.
Edit: Here is some info I forgot to mention. The files I want to display are being stored in the database. I'm grabbing the file from there and storing in a custom class as a ByteArray. I then pass the ByteArray to my helper class that formats the POST data request and stores the result in URLRequest.data.
Here's what my request looks like:
--lljcuqjclcnyicgrmwexayhafmkhiwfx
Content-Disposition: form-data; name="Filename"
arrows.png
--lljcuqjclcnyicgrmwexayhafmkhiwfx
Content-Disposition: form-data; name="Filedata"; filename="arrows.png"
Content-Type: image/png
?PNG
"image information as ByteArray"
--lljcuqjclcnyicgrmwexayhafmkhiwfx
Content-Disposition: form-data; name="Upload"
Submit Query
--lljcuqjclcnyicgrmwexayhafmkhiwfx--
So I'm looking for a way (using Javascript and HTML ideally) to handle that request and have the browser display the file (or display an open/save dialog if the user doesn't have the proper plugins to display).