3 Replies Latest reply on Apr 25, 2008 11:43 AM by andrei_exadel

    How I can't get the last modification date of uploaded file

    paradox79

      I try to use control rich:uploadFile in my xhtml. And I have to know the modification time of uploaded file. But rich:uploadFile operates with temporary files after the upload process. So when I operate with file in my fileUploadListener method I get not the date of last modification of uploaded file but a creation date of temporary file. Kindly tell me how I can deal in this situation.

        • 1. Re: How I can't get the last modification date of uploaded f

          It's impossible to get the last modification time, because browser sends file as byte array. File upload request contains no information about modification time.

          On the other part it impossible to get file information on client side through javascript by security reasons.

          • 2. Re: How I can't get the last modification date of uploaded f
            paradox79

            Thanks for your quick answer, Andrei. I just thought that if tag rich:fileUpload has parameter fileUploadListener presenting an action listener method that will be notified after file uploaded. And also there is a parameter immediateUpload. If we put it to "false" then uploading is divided into two phases. After first phase the file is added to a list and we see it's name in local file system. So I thought that maybe there is some fileAddToListListener parameter that presents an action listener method in order to work with files list after adding but before upload.

            • 3. Re: How I can't get the last modification date of uploaded f

              There is a onupload attribute. You can this attribute to specify some javascript code. Or you can use 'onupload' event to force ajax request to server or to do any thing you want. This event fires after file was added to list but before uploading process started.