Downloading filename problem

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Downloading filename problem

    I need to have php download a datafile to use locally, and using the
    following code it will download it, but for some reason it ignores my
    filename="ticket.csv", and it just insists on calling the file by the name
    of the php program.


    header("Content-Type: application/force-download");
    header("Content-Type: text/comma-separated-values");
    header("Content-Type: application/download");
    header("Content-Disposition: attachment; filename=ticket.csv");
    header("Content-Transfer-Encoding: binary");

    I see from other postings that browsers are sometimes grouchy about this,
    but I'm not getting "ticket.csv.php" -- I'm just getting the name of the
    program file, box_office.php. I need to be able to set the default
    filename.

    Doesn't filename= work at all??? Thanks for your help!

    Ness Blackbird
    Ness Mountain Guest

  2. Similar Questions and Discussions

    1. problem downloading
      maybe you can help me find another way of downloading adobe flash player
    2. cfcontent filename problem
      Hello all- I'm trying to use cfcontent to force the download of an exe. The problem is that when the save to disk dialog box opens, the filename...
    3. Query in Index Server: @filename search problem
      I try to do some search in ASP using the filename on an Index server Catalog. The filename begin with date (2001_06_13.html). I do some search with...
    4. PC to Mac jpg Filename Problem
      I'm using PS 7.0.1 on XP Pro, and whenever I save a jpg file and burn it to disc, the filenames dislay completely different on a Mac. For example,...
    5. problem downloading doc with IE
      hi all, Lately, I found that when I click on a "link to a word doc" in IE, i can neither display nor download such doc. If I life click it,...
  3. #2

    Default Re: Downloading filename problem

    On Sat, 30 Aug 2003 02:38:24 -0500, in message
    <Xns93E7724547F3nesswillowmountainco@129.250.170.8 4>, the AI program named
    "Ness Mountain" <dontspamness@willowmountain.com> randomly printed:
    > I need to have php download a datafile to use locally, and using the
    > following code it will download it, but for some reason it ignores my
    > filename="ticket.csv" [...]
    According to the HTTP spec (RFC 2616 section 19), you
    should only need the "Content-type: application/octet-stream"
    header to cause the "Save response As..." dialog to
    be displayed, and the rfc also seems to indicate that
    the filename parameter is just a suggestion; I don't
    think that browsers have to respect it.

    Gary Petersen Guest

  4. #3

    Default Re: Downloading filename problem

    Gary Petersen <garyp1492@remove.meearthlink.invalid> wrote in
    news:pan.2003.09.01.05.48.17.29287.426@REMOVE.MEea rthlink.INVALID:
    >> I need to have php download a datafile to use locally, and using the
    >> following code it will download it, but for some reason it ignores my
    >> filename="ticket.csv" [...]
    >
    > According to the HTTP spec (RFC 2616 section 19), you
    > should only need the "Content-type: application/octet-stream"
    > header to cause the "Save response As..." dialog to
    > be displayed, and the rfc also seems to indicate that
    > the filename parameter is just a suggestion; I don't
    > think that browsers have to respect it.
    >
    Well, that's a bummer!!!
    Ness Mountain Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139