3 Replies Latest reply on Sep 20, 2004 1:47 PM by thepriz

    Retrieve file name after upload

    mbalz

      Hello,

      how can I get the file name of an uploaded file?
      The MultipartRequest.File class has no such attribute.

      TIA
      Moritz

        • 1. Re: Retrieve file name after upload

          I thought that theute added it for the bb module attachments, waht nukes branch is it ?

          • 2. Re: Retrieve file name after upload
            theute

            In HEAD:
            In MultipartRequest there is the method:
            /**
            * Returns an uploaded file.
            * @param name the name of the parameter
            * @return the file or null if it does not exists
            */
            public UploadedFile getFileParameter(String name)


            In UploadedFile there is:
            /**
            * Give the original name of the file if provided by the client
            * @return Original name of the file
            */
            public String getName()

            And you get what you want :)

            • 3. Re: Retrieve file name after upload

              This is great. I actually did this for the project that I was working on and didn't think about checking it in till I saw this but it is already done, oh well.