1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I know that if you have a reference to a .doc file in your html code, for example:
    <a href="anyfile.doc">file</a>,
    a web browser will allow the person to choose if he wants to save the document or open it in MS word. If the person chooses to open it, the browser calls word and opens the file in it. Can I get the web browser to do the same with a .html file?
    Thanks for any feedback.
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    The only reason that word open with a .doc href, is that it is set that way with the machines mime type body part.

    I would imagine that you'd want your web browser to treat .html files *as* to opened in a browser.

    I suppose you could change your mime type setting in the registry, but then all .html files would open in word, rendering the browser a bit pointless.

    If you sent the document to a browser with a mime header so bizzare it didn't understand it, then the browser may default to 'save as'/'open as' mode.

    Why do you want to do this?

    > James <
    > james@xch.net <
  4. #3
  5. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    What the customer wanted was a button to push to generate a FORMATTED word document. The problem was that this was the result of a search, and we wanted a dynamic result, thus the ".html " extension.

    We ended up writing RTF to an html file so we could manipulate the format. You were right about how to get it to open in word, I just changed the content-type in the header of the file to "application/rtf" so the browser would prompt with the 'save as'/'open as'.

    Thanks for your help,

Similar Threads

  1. Delete file from browser cache
    By CEO in forum Perl Programming
    Replies: 2
    Last Post: January 12th, 2004, 06:57 AM
  2. Replies: 0
    Last Post: October 22nd, 2003, 09:10 AM
  3. help removing word HTML from a file
    By martincrumlish in forum PHP Development
    Replies: 3
    Last Post: June 18th, 2003, 07:07 AM
  4. Replies: 3
    Last Post: October 29th, 2002, 03:13 PM
  5. file pointer at beginning of file....
    By ROT in forum PHP Development
    Replies: 9
    Last Post: August 3rd, 2000, 03:50 PM

IMN logo majestic logo threadwatch logo seochat tools logo