Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.10-incubating
    • Fix Version/s: 0.9.12-incubating
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 16, docker containers on latest 0.9.10 with Windows internet explorer client.

      Description

      When downloading an office file format using the guacamole file transfer Internet Explorer will save an xlsx file as a zip file. This does not happen on the earlier 0.9.9 release. Possibly a missing server mime-type.

        Issue Links

          Activity

          Hide
          mike.jumper Michael Jumper added a comment -

          The mimetype used by Guacamole here is simply "application/octet-stream", and this was actually also the mimetype used in past releases. Only the download mechanism was changed, in this case relying on the browser itself to handle the download, rather than assemble the file piece by piece with JavaScript alone.

          Unfortunately, the reason that Internet Explorer is saving ".xlsx" as ".zip" is because it is ignoring the "application/octet-stream" mimetype, instead inspecting the contents of the file: https://msdn.microsoft.com/en-us/library/ms775147(v=vs.85).aspx

          Because a ".xlsx" file is actually a ".zip" file containing an XML-based Office document (and related files), it is misrecognized by Internet Explorer as a ".zip".

          It looks like this can be resolved through using the "Content-Disposition" header. From the link above:

          If the file is marked as "content-disposition=attachment" in the HTTP header, Internet Explorer treats the file name from the URL as final and does not rename it before placing it in the cache.

          I'm slightly surprised that Microsoft's own browser fails to properly detect the mimetype of Microsoft's own document type ... but designing a browser to universally assume "application/octet-stream" is incorrect and override the mimetype is pretty brain-damaged already.

          Show
          mike.jumper Michael Jumper added a comment - The mimetype used by Guacamole here is simply "application/octet-stream", and this was actually also the mimetype used in past releases. Only the download mechanism was changed, in this case relying on the browser itself to handle the download, rather than assemble the file piece by piece with JavaScript alone. Unfortunately, the reason that Internet Explorer is saving ".xlsx" as ".zip" is because it is ignoring the "application/octet-stream" mimetype, instead inspecting the contents of the file: https://msdn.microsoft.com/en-us/library/ms775147(v=vs.85).aspx Because a ".xlsx" file is actually a ".zip" file containing an XML-based Office document (and related files), it is misrecognized by Internet Explorer as a ".zip". It looks like this can be resolved through using the "Content-Disposition" header. From the link above: If the file is marked as "content-disposition=attachment" in the HTTP header, Internet Explorer treats the file name from the URL as final and does not rename it before placing it in the cache. I'm slightly surprised that Microsoft's own browser fails to properly detect the mimetype of Microsoft's own document type ... but designing a browser to universally assume "application/octet-stream" is incorrect and override the mimetype is pretty brain-damaged already.
          Hide
          giuliomdsl Giulio D'Ali added a comment - - edited

          Michael Jumper Just testing this further and the Content-Disposition header is almost critical for IE11 to work. If you have the popup blocker turned on (which most of our customers do), then the download silently fails and nothing works.

          Using fiddler, I intercepted the traffic and simply added the missing header. This fixed two issues:

          1) IE11 actually giving a download prompt for the file, even with popup blocker turned on
          2) For an XLSX file, actually saved with an XLS extension, it will download correctly without any inspection or modification.

          This is the fiddler code I tested with:

          static function OnBeforeResponse(oSession: Session)
          {

          if(oSession.fullUrl.Contains("test.txt"))
          oSession.ResponseHeaders.Add("Content-Disposition", "attachment; filename=\"test.txt\"");

          if(oSession.fullUrl.Contains("GDTEST.xls"))
          oSession.ResponseHeaders.Add("Content-Disposition", "attachment; filename=\"GDTEST.xls\"");
          }

          I'm not 100% sure, but I think the header would need to come in here, using the fileName passed in:
          https://github.com/apache/incubator-guacamole-client/blob/057a0922637c3f92c761cf26b1a6cb3d9eec8624/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java#L132

          Show
          giuliomdsl Giulio D'Ali added a comment - - edited Michael Jumper Just testing this further and the Content-Disposition header is almost critical for IE11 to work. If you have the popup blocker turned on (which most of our customers do), then the download silently fails and nothing works. Using fiddler, I intercepted the traffic and simply added the missing header. This fixed two issues: 1) IE11 actually giving a download prompt for the file, even with popup blocker turned on 2) For an XLSX file, actually saved with an XLS extension, it will download correctly without any inspection or modification. This is the fiddler code I tested with: static function OnBeforeResponse(oSession: Session) { if(oSession.fullUrl.Contains("test.txt")) oSession.ResponseHeaders.Add("Content-Disposition", "attachment; filename=\"test.txt\""); if(oSession.fullUrl.Contains("GDTEST.xls")) oSession.ResponseHeaders.Add("Content-Disposition", "attachment; filename=\"GDTEST.xls\""); } I'm not 100% sure, but I think the header would need to come in here, using the fileName passed in: https://github.com/apache/incubator-guacamole-client/blob/057a0922637c3f92c761cf26b1a6cb3d9eec8624/guacamole/src/main/java/org/apache/guacamole/rest/tunnel/TunnelResource.java#L132

            People

            • Assignee:
              mike.jumper Michael Jumper
              Reporter:
              mrbabbage Robin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development