Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-6370

Non-file Blob doens't set Content-Disposition header (bug in MultipartInput.java)

    XMLWordPrintable

    Details

      Description

      In case the datasource is not a file the filename isn't set (Content-Disposition header). Therefore the filename in Nuxeo isn't shown althought it is set in the Blob object.

      I created the patch attached to check if the filename is set in the blob and set the header in case.

      — Documents/Projects/nuxeo-features/nuxeo-automation/nuxeo-automation-client/src/main/java/org/nuxeo/ecm/automation/client/jaxrs/util/MultipartInput.java 2011-02-14 14:45:15.353754200 +0100
      +++ Documents/Projects/nuxeo-automation-client/src/main/java/org/nuxeo/ecm/automation/client/jaxrs/util/MultipartInput.java 2011-02-14 09:53:03.401306800 +0100
      @@ -55,6 +56,10 @@ public class MultipartInput extends Mime
      part.attachFile(((HasFile) blob).getFile());
      } else {
      part.setDataHandler(new DataHandler(new BlobDataSource(blob)));
      +
      + if (blob.getFileName() != null)

      { + part.setFileName(blob.getFileName()); + }

      }
      part.setHeader("Content-Type", blob.getMimeType());
      part.setHeader("Content-Transfer-Encoding", "binary");

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: