Results 1 to 3 of 3
  1. #1
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Force a download of .html file?

    I created a page that runs a script that generates an HTML file. I find that it's a hassle for users to save the HTML file without choosing the (useless) "complete" format. If I could avoid ever having to explain IE's Save As dialog again, I would be so happy. Which brings me to my question. On download pages, I often see the message that a file will start automatically downloading (often after a short delay). These typically are EXE or ZIP files. Can one force the Save dialog to come up for an HTML file, or is IE destined always to just automatically display it? If one could force the dialog, how would one do it. Inquiring minds need to know. <img src=/S/please.gif border=0 alt=please width=31 height=23>

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Force a download of .html file?

    Hi Jefferson,

    I've never tried donig this with an html file, but the trick lies in the http headers. I've used a free 3rd party component (aspSmartUpload) to force a download with other file types. I'd bet dollars to doughnuts it will work with html files as well. (Despite the misleading directional name, the component also has rich download features as well.)

    It's pretty easy to code and there are samples galore on their website. Let me know if you need any further assistance or suggestions.

    Good luck!

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Force a download of .html file?

    Thanks, Mark. My current incarnation is not an ASP page, but I'll see if I can learn from the control a way to do it "client-side."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •