Download Servlet for .zip-Files on IE 6 and https

Discussion in 'Java' started by StefanSt, Aug 23, 2005.

  1. StefanSt

    StefanSt Guest

    Hello,

    my Servlet creates a zip-File on the fly and works fine, but with https
    and IE 6 there is a problem:
    The filename in the Download-Box of IE is not correct and the file
    extension .zip isn't there.

    SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd__HH:mm:ss");
    String zipFile=sdf.format(new Date()) +".zip";
    res.setContentType("application/zip");
    res.setHeader("Content-Disposition", "attachment;filename=\""+ zipFile
    +"\";");
    ....
    ....

    With Firefox: no problems

    thanks

    Stefan
     
    StefanSt, Aug 23, 2005
    #1
    1. Advertising

  2. StefanSt

    Roedy Green Guest

    On 23 Aug 2005 07:09:23 -0700, "StefanSt"
    <> wrote or quoted :

    >The filename in the Download-Box of IE is not correct and the file
    >extension .zip isn't there.


    In windows there in an option to hide certain extensions. IE tends to
    pay more attention to OS settings that other browsers. Perhaps that
    is what is hiding the .zip on you.

    Look in the extension associations.

    see http://mindprod.com/jgloss/associations.html
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com
     
    Roedy Green, Aug 23, 2005
    #2
    1. Advertising

  3. StefanSt

    Roedy Green Guest

    On 23 Aug 2005 07:09:23 -0700, "StefanSt"
    <> wrote or quoted :

    > SimpleDateFormat("yyyy-MM-dd__HH:mm:ss");


    colon is a reserved char in windows filenames. It means drive letter.

    Stick to a very vanilla set of filename chars if you want to avoid
    trouble on all platforms.

    Also I think it wise to start a filename with an alpha character --
    treat it much like a Java identifier.

    And finally I think a filename should give some clue as to what the
    file is when seen in isolation, so you might name it something like

    dailyraceresults2005-08-23-235959.zip

    Unless it lives in a directory with nothing but similar files, than
    the directory name can give that info. e.g.

    dailyraceresults/d2005-08-23-23_59_59.zip
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com
     
    Roedy Green, Aug 23, 2005
    #3
  4. StefanSt

    StefanSt Guest

    Roedy Green wrote:
    > On 23 Aug 2005 07:09:23 -0700, "StefanSt"
    > <> wrote or quoted :
    >
    > > SimpleDateFormat("yyyy-MM-dd__HH:mm:ss");

    >
    > colon is a reserved char in windows filenames. It means drive letter.
    >

    Thanks for the tip. without colon it's ok.

    Stefan
     
    StefanSt, Aug 24, 2005
    #4
    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. Paul Jacobs
    Replies:
    3
    Views:
    4,638
    Neomorph
    Aug 25, 2003
  2. circuit_breaker
    Replies:
    2
    Views:
    2,095
    Jack Jia
    Apr 4, 2004
  3. Alex Hunsley
    Replies:
    1
    Views:
    627
    Andrew Thompson
    Sep 16, 2004
  4. MoshiachNow
    Replies:
    2
    Views:
    302
    Ilya Zakharevich
    Oct 4, 2006
  5. Bo Yang
    Replies:
    9
    Views:
    332
    -berlin.de
    Nov 20, 2006
Loading...

Share This Page