FileResource Label (file download) and SSL


I have following file download label inside a view:

    FileResource fileRes = new FileResource(file, getApplication());
    Link lnkFile = new Link(fileRes.getFilename(), fileRes);

My Web application runs on glassfish 3.1. Without SSL (Port 8080) the file download link works on all browsers fine (Firefox, IE7/8/9). But if I use a SSL connection (Port 8181) I cannot download the file on IE7 and IE8. The error message is:

File.dat von kann nicht runtergeladen werden.
Die Internetsite konnte nicht geöffnet werden. Sie ist entweder nicht verfügbar oder konnte nicht gefunden werden. Versuchen Sie es später erneut.

Translated from german to english: cannot be downloaded from
The internet site could not be open. The site is not available or could not be found. Please try it again later.

On Firefox and IE9 it works also fine with SSL.

Is this is a configuration problem? Is there any trick to download a file with SSL on IE7/8 with a resource link?

Thanks and regards,

This is probably caused by this bug:

YES! That’s it!

After setting the cache time to 1ms in FileResource it works.

  /** {@inheritDoc}
  public DownloadStream getStream() {
    DownloadStream dStream = super.getStream();
    dStream.setParameter("Content-Disposition", "attachment; filename=\"" + getFilename() + "\"");
    dStream.setCacheTime(1);  // <<<<<<<<< This is the workaround!!!! :-)
    return dStream;

Many thanks and regards,

Note that its also important to override the FileResource.getCacheTime() method:

  /** {@inheritDoc}
  public long getCacheTime() {
    return 1;