Download-Script: strange "[1]." in Filename

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

    Download-Script: strange "[1]." in Filename

    Hello folks!

    I've got a strange problem with my download-script in conjunction with
    M$ internet explorer, if the filename I want to link to includes more
    than one points. In Netscape the problem doesn't exist.

    For example:

    input: ... download.php?na me=virtualdub_1 .4.9.zip

    Code:
    header("Content-Type: application/octet-stream");
    header("Content-Length: " . filesize($file));
    header("Content-Disposition: attachment; filename=".$name);
    header("Content-Transfer-Encoding: binary");
    output: ... save file to disk: virtualdub_1[1].4.9.zip

    Plz hlp! Thx.
    Kornelius F.

  • R. Rajesh Jeba Anbiah

    #2
    Re: Download-Script: strange "[1]." in Filename

    Kornelius Finkenbein <kofi1@web.de > wrote in message news:<bp0cm1$nk $05$1@news.t-online.com>...[color=blue]
    > Hello folks!
    >
    > I've got a strange problem with my download-script in conjunction with
    > M$ internet explorer, if the filename I want to link to includes more
    > than one points. In Netscape the problem doesn't exist.
    >
    > For example:
    >
    > input: ... download.php?na me=virtualdub_1 .4.9.zip
    >
    >
    Code:
    > 	header("Content-Type: application/octet-stream");
    > 	header("Content-Length: " . filesize($file));
    > 	header("Content-Disposition: attachment; filename=".$name);
    > 	header("Content-Transfer-Encoding: binary");
    >
    >
    > output: ... save file to disk: virtualdub_1[1].4.9.zip
    >[/color]

    Try this:

    <?php
    header('Content-Type: XXXXXXXXXXXXXX' );
    //IE need specific header
    if (strstr($_SERVE R['HTTP_USER_AGEN T'], "MSIE"))
    {
    header('Content-Disposition: inline; filename="'.$fi le_name.'"');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    }
    else
    {
    header('Content-Disposition: attachment;
    filename="'.$fi le_name.'"');
    header('Pragma: no-cache');
    }
    ?>

    If it doesn't work read the usernotes at http://in.php.net/header
    that may be helpful.

    ---
    "War kills you and me"
    Email: rrjanbiah-at-Y!com

    Comment

    • Kornelius Finkenbein

      #3
      Re: Download-Script: strange &quot;[1].&quot; in Filename

      Thanks for your help, but that didn't solve the problem yet.
      I've looked on http://in.php.net/header and searched again in Google,
      but I can't find a solution for it.

      Perhaps it's the best to eliminate all points in filename except the
      last one of course.

      Thx. Kornelius



      R. Rajesh Jeba Anbiah schrieb:[color=blue]
      > Kornelius Finkenbein <kofi1@web.de > wrote in message news:<bp0cm1$nk $05$1@news.t-online.com>...
      >[color=green]
      >>Hello folks!
      >>
      >>I've got a strange problem with my download-script in conjunction with
      >>M$ internet explorer, if the filename I want to link to includes more
      >>than one points. In Netscape the problem doesn't exist.
      >>
      >>For example:
      >>
      >>input: ... download.php?na me=virtualdub_1 .4.9.zip
      >>
      >>
      Code:
      >>	header("Content-Type: application/octet-stream");
      >>	header("Content-Length: " . filesize($file));
      >>	header("Content-Disposition: attachment; filename=".$name);
      >>	header("Content-Transfer-Encoding: binary");
      >>
      >>
      >>output: ... save file to disk: virtualdub_1[1].4.9.zip
      >>[/color]
      >
      >
      > Try this:
      >
      > <?php
      > header('Content-Type: XXXXXXXXXXXXXX' );
      > //IE need specific header
      > if (strstr($_SERVE R['HTTP_USER_AGEN T'], "MSIE"))
      > {
      > header('Content-Disposition: inline; filename="'.$fi le_name.'"');
      > header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
      > header('Pragma: public');
      > }
      > else
      > {
      > header('Content-Disposition: attachment;
      > filename="'.$fi le_name.'"');
      > header('Pragma: no-cache');
      > }
      > ?>
      >
      > If it doesn't work read the usernotes at http://in.php.net/header
      > that may be helpful.
      >
      > ---
      > "War kills you and me"
      > Email: rrjanbiah-at-Y!com[/color]

      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: Download-Script: strange &quot;[1].&quot; in Filename

        Kornelius Finkenbein <kofi1@web.de > wrote in message news:<bp28tl$6m d$01$1@news.t-online.com>...[color=blue]
        > Thanks for your help, but that didn't solve the problem yet.
        > I've looked on http://in.php.net/header and searched again in Google,
        > but I can't find a solution for it.
        >
        > Perhaps it's the best to eliminate all points in filename except the
        > last one of course.[/color]

        I dont' think, it will help you. Just checked phpMyAdmin; it also
        has the same problem with zip. If even phpMyAdmin guys couldn't solve
        this problem, I don't think it's possible. Anyway, you keep on trying.
        Probably some HTTP sniff will be useful to you.

        ---
        "Believe it or not, patriotism is one of the worst dividing forces"
        Email: rrjanbiah-at-Y!com

        Comment

        • R. Rajesh Jeba Anbiah

          #5
          Re: Download-Script: strange &quot;[1].&quot; in Filename

          ng4rrjanbiah@re diffmail.com (R. Rajesh Jeba Anbiah) wrote in message news:<abc4d8b8. 0311142144.3ec6 762c@posting.go ogle.com>...[color=blue]
          > Kornelius Finkenbein <kofi1@web.de > wrote in message news:<bp28tl$6m d$01$1@news.t-online.com>...[color=green]
          > > Thanks for your help, but that didn't solve the problem yet.
          > > I've looked on http://in.php.net/header and searched again in Google,
          > > but I can't find a solution for it.
          > >
          > > Perhaps it's the best to eliminate all points in filename except the
          > > last one of course.[/color]
          >
          > I dont' think, it will help you. Just checked phpMyAdmin; it also
          > has the same problem with zip. If even phpMyAdmin guys couldn't solve
          > this problem, I don't think it's possible. Anyway, you keep on trying.
          > Probably some HTTP sniff will be useful to you.[/color]

          I checked Yahoo! It doesn't have this problem and so worked on
          the headers... Finally found the solution!!!! Now, it works fine!!!

          <?php
          //This file name: download_zip.ph p
          //Tested in IE6

          $filename = "rajesh.zip ";
          header('Content-Type: application/x-zip-compressed;
          filename="foo.b ar"');
          header('Content-Disposition: attachment; filename="' . $filename .
          '"');
          readfile($filen ame);
          exit;
          ?>

          <!---html file name: test.html--->

          <a href="download_ zip.php">test</a>



          Now, open the test.html and click the link. Please confirm, if
          it's work for you.

          ---
          "Believe it or not, patriotism is one of the worst dividing forces"
          Email: rrjanbiah-at-Y!com

          Comment

          • Kornelius Finkenbein

            #6
            Re: Download-Script: strange &quot;[1].&quot; in Filename

            Don't know if you understood my problem: I have no problem with the
            download-script in conjunction with zip-files. The problem exists only,
            if files have more than one point in the filename: f.e.
            "virtualdub_1.5 .9.zip". Before the first point I get this: "[1]".
            The result is this filename: "virtualdub _1[1].5.9.zip".

            Your filename "rajesh.zip " has only one point, thats no problem.
            BTW, I could not open a test.htm. There were no attachment or link.

            But thanks anyway for all.
            Kornelius.

            [color=blue]
            >
            >
            > I checked Yahoo! It doesn't have this problem and so worked on
            > the headers... Finally found the solution!!!! Now, it works fine!!!
            >
            > <?php
            > //This file name: download_zip.ph p
            > //Tested in IE6
            >
            > $filename = "rajesh.zip ";
            > header('Content-Type: application/x-zip-compressed;
            > filename="foo.b ar"');
            > header('Content-Disposition: attachment; filename="' . $filename .
            > '"');
            > readfile($filen ame);
            > exit;
            > ?>
            >
            > <!---html file name: test.html--->
            >
            > <a href="download_ zip.php">test</a>
            >
            >
            >
            > Now, open the test.html and click the link. Please confirm, if
            > it's work for you.
            >
            > ---
            > "Believe it or not, patriotism is one of the worst dividing forces"
            > Email: rrjanbiah-at-Y!com[/color]

            Comment

            • FLEB

              #7
              Re: Download-Script: strange &quot;[1].&quot; in Filename

              On Mon, 17 Nov 2003 12:11:10 +0100, Kornelius Finkenbein wrote:
              [color=blue]
              > Don't know if you understood my problem: I have no problem with the
              > download-script in conjunction with zip-files. The problem exists only,
              > if files have more than one point in the filename: f.e.
              > "virtualdub_1.5 .9.zip". Before the first point I get this: "[1]".
              > The result is this filename: "virtualdub _1[1].5.9.zip".
              >
              > Your filename "rajesh.zip " has only one point, thats no problem.
              > BTW, I could not open a test.htm. There were no attachment or link.
              >
              > But thanks anyway for all.
              > Kornelius.
              >
              >[color=green]
              >>
              >>
              >> I checked Yahoo! It doesn't have this problem and so worked on
              >> the headers... Finally found the solution!!!! Now, it works fine!!!
              >>
              >> <?php
              >> //This file name: download_zip.ph p
              >> //Tested in IE6
              >>
              >> $filename = "rajesh.zip ";
              >> header('Content-Type: application/x-zip-compressed;
              >> filename="foo.b ar"');
              >> header('Content-Disposition: attachment; filename="' . $filename .
              >> '"');
              >> readfile($filen ame);
              >> exit;
              >> ?>
              >>
              >> <!---html file name: test.html--->
              >>
              >> <a href="download_ zip.php">test</a>
              >>
              >>
              >>
              >> Now, open the test.html and click the link. Please confirm, if
              >> it's work for you.
              >>
              >> ---
              >> "Believe it or not, patriotism is one of the worst dividing forces"
              >> Email: rrjanbiah-at-Y!com[/color][/color]

              Are you sure you don't have a file already called (whatever it was you were
              trying to download) already? Usually the [1] comes when some program (like
              IE) has to give a downloaded file a new name because the current file
              already exists.

              Also, have you tried the page in other browsers? If it works in something
              else, it's probably just some sort of client-side problem. You could also
              get a header-sniffer to see what the actual filename the script is giving
              you is.
              --
              -- Rudy Fleminger
              -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
              (put "Hey!" in the Subject line for priority processing!)
              -- http://www.pixelsaredead.com

              Comment

              • R. Rajesh Jeba Anbiah

                #8
                Re: Download-Script: strange &quot;[1].&quot; in Filename

                Kornelius Finkenbein <kofi1@web.de > wrote in message news:<bpaabu$si h$06$1@news.t-online.com>...[color=blue]
                > Don't know if you understood my problem: I have no problem with the
                > download-script in conjunction with zip-files. The problem exists only,
                > if files have more than one point in the filename: f.e.
                > "virtualdub_1.5 .9.zip". Before the first point I get this: "[1]".
                > The result is this filename: "virtualdub _1[1].5.9.zip".[/color]

                Sorry for misunderstandin g your problem. Yes, it seems to dislike
                the extra points in file name. It's really strange.

                ---
                "War kills you and me"
                Email: rrjanbiah-at-Y!com

                Comment

                Working...