views:

44

answers:

2

Hey guys,

I'm still rebuilding old ASP to new and iframing certain things that take up too much time. I'm stuck at a search function that normally returns an excel file (browser asks save or open). the result page for this is now iframed but it does not seem to propagate the file anymore, so no more save-file popup.

I must add that this iframe is being filled through a custom httphandler that posts to the old pages based on certain criterie, the searchcriteria in this case.

does anyone have an idea on how I could make the excel propagate once again?

A: 

It *seems* like a security issue. What happens if you open the URL which is being loaded in the IFrame in a new browser? To confirm it, you can try opening the URL, and see what happens.

Kirtan
in a new browser, without the iframe it loads as it shoudl, the savefile appears. as I see it the iframe is "blocking" the stream ... and that's the thing I don't want
Jan W.
+1  A: 

The way to ensure you get a save-file prompt and not a page, do the following:

  • Open the file in ASP
  • Send the MIME header for Excel
  • Stream out the file from ASP

You may also choose to hold the files outside of the web root so they cannot be downloaded directly.

Here are a few examples: 1 2 3

This may come in handy as well:

http://stackoverflow.com/questions/440892/how-to-output-an-excel-xls-file-from-classic-asp

Diodeus