Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1115

How do I get access to original filename while using @MultipartForm

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Critical Critical
    • None
    • 3.0.6.Final
    • jaxrs
    • None

      I am using resteasy 3.0.6.Final I am trying to upload a file and access the content-disposition header in my POJO. Below is my POJO.

      public class SoftwarePackageForm {
      @FormParam("softwarePackage")
      private File file;
      //I want to inject the contentDisposition here or the originalFileName with extention
      //@?????("Content-Disposition/filename")
      private String contentDisposition;

      public File getFile()

      { return file; }

      public void setFile(File file)

      { this.file = file; }

      public String getContentDisposition()

      { return contentDisposition; }

      public void setContentDisposition(String contentDisposition)

      { this.contentDisposition = contentDisposition; }

      }

      I am getting null when I access softwarePackageForm.getContentDisposition().

      I tried with @FormParam("Content-Disposition") and @HeaderParam("Content-Disposition") and @HeaderParam with a combination of @PartType("application/octet-stream"). All trials resulted in the same null.

      How can I get the original file name when using @MultipartForm. Can anyone please let me know if this possible and how?

      Thank you all in advance.

            patriot1burke@gmail.com Bill Burke (Inactive)
            pinakini64 krishna chaitanya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: