forcing a txt file download

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lmb

    forcing a txt file download

    Hi all,

    Does anyone know how to force the download of a text file ?
    In my script, I tried : header("locatio n: my_text_file.tx t") ;
    ....and of course, I get my text in my browser as I wanted a download dialog
    box to appear.

    Any help,

    Many thanks in advance,

    --
    lmb


  • lmb

    #2
    Re: forcing a txt file download

    "lmb" <lmb@nospam.org > a écrit dans le message news:
    40361999$0$2814 6$636a15ce@news .free.fr...[color=blue]
    > Hi all,
    >
    > Does anyone know how to force the download of a text file ?
    > In my script, I tried : header("locatio n: my_text_file.tx t") ;
    > ...and of course, I get my text in my browser as I wanted a download[/color]
    dialog[color=blue]
    > box to appear.
    >
    > Any help,
    >
    > Many thanks in advance,
    >
    > --
    > lmb[/color]

    Oops, ok, I've just found.
    was :
    header("Content-type: application/force-download");
    header("Content-Disposition: attachment; filename=test.t xt");
    readfile("test. txt");

    --
    lmb


    Comment

    • John Dunlop

      #3
      Re: forcing a txt file download

      lmb wrote:
      [color=blue]
      > Does anyone know how to force the download of a text file ?[/color]

      Intimidation, thuggery, trickery... Sorry, that's all for the moment.

      --
      Jock

      Comment

      Working...