This is bizarre html behaviour...

Discussion in 'HTML' started by Pascal Herczog, Nov 13, 2005.

  1. I've got a simple html file (fileA), with a table in which each cell
    contains a hyperlink to a standard text (.txt) file.

    The page consists of 2 frames, with fileA in the top frame. In the <head> of
    fileA is

    <base target="bottom">

    to direct the result of clicking on each hyperlink to the bottom frame.

    On my WinXP desktop, whether loading this from my C: drive, or from my ISP
    webspace, it works fine for every text file within IE.

    But what I'm finding on my Win2k laptop is that some text files do indeed
    get printed to the bottom frame, but others cause the IE browser to ask
    whether to open the file, download (save) it or cancel. I can see absolutely
    no difference in the way in which each .txt file is defined in the
    hyperlink. I can only assume that somehow, the content of a .txt file cause
    this behaviour. But WHY? (and can I force it to treat it as normal text?)

    Cheers,
    Pascal
    Pascal Herczog, Nov 13, 2005
    #1
    1. Advertising

  2. Pascal Herczog

    Toby Inkster Guest

    Pascal Herczog wrote:

    > I can only assume that somehow, the content of a .txt file cause
    > this behaviour. But WHY? (and can I force it to treat it as normal text?)


    More likely it's the Content-Type HTTP header.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Nov 13, 2005
    #2
    1. Advertising

  3. "Toby Inkster" <> wrote in message
    news:5n.co.uk...
    > Pascal Herczog wrote:
    >
    >> I can only assume that somehow, the content of a .txt file cause
    >> this behaviour. But WHY? (and can I force it to treat it as normal text?)

    >
    > More likely it's the Content-Type HTTP header.


    Not sure I understand, as the text files are just plain text, and don't
    contain any specific html code.

    Pascal
    Pascal Herczog, Nov 14, 2005
    #3
  4. Pascal Herczog

    Toby Inkster Guest

    Pascal Herczog wrote:

    > Not sure I understand, as the text files are just plain text, and don't
    > contain any specific html code.


    If they are sent by HTTP, they will be sent with an HTTP header. This
    header contains a "Content-Type" line which tells the browser what type of
    file it's dealing with. If this line is wrong, the browser may act
    strangely.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Nov 15, 2005
    #4
  5. "Toby Inkster" <> wrote in message
    news:eek:5n.co.uk...
    > Pascal Herczog wrote:
    >
    >> Not sure I understand, as the text files are just plain text, and don't
    >> contain any specific html code.

    >
    > If they are sent by HTTP, they will be sent with an HTTP header. This
    > header contains a "Content-Type" line which tells the browser what type of
    > file it's dealing with. If this line is wrong, the browser may act
    > strangely.
    >


    Ok, so I've simply uploaded these text files to my webspace, how can I
    ensure that when they are sent to the user they are forced to be interpreted
    as ordinary text files, destined for the page frame that I've prescibed?

    Or can I put something in the <a href...=File.txt> line to do this?

    Pascal.
    Pascal Herczog, Nov 15, 2005
    #5
  6. Pascal Herczog

    Toby Inkster Guest

    Pascal Herczog wrote:

    > Ok, so I've simply uploaded these text files to my webspace, how can I
    > ensure that when they are sent to the user they are forced to be interpreted
    > as ordinary text files, destined for the page frame that I've prescibed?


    Try:
    http://www.rexswain.com/httpview.html

    to view your HTTP headers.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Nov 15, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony
    Replies:
    2
    Views:
    1,598
  2. Simon Pryor
    Replies:
    5
    Views:
    1,117
    Peter Kragh
    Jun 17, 2004
  3. musosdev
    Replies:
    0
    Views:
    569
    musosdev
    Jul 1, 2008
  4. Brian Wakem

    Bizarre regex behaviour

    Brian Wakem, Aug 5, 2005, in forum: Perl Misc
    Replies:
    9
    Views:
    111
    Anno Siegel
    Aug 8, 2005
  5. Sean Inglis

    Bizarre instanceof behaviour

    Sean Inglis, Jan 11, 2007, in forum: Javascript
    Replies:
    3
    Views:
    90
    Douglas Crockford
    Jan 12, 2007
Loading...

Share This Page