XPages: Questions on attachments (Upload)

Hi,NotesXSPDocument.getAttachmentList() returns an ArrayList of com.ibm.xsp.model.domino.wrapped.DominoDocument$AttachmentValueHolder objects with methods for getting the name, type, last-modified etc. getName(), getType(), getLastModified(). I want to check the file size in my button before I save the uploaded file as an attachment in my document. I noticed that the file objects have an instance variable called _fileSize, which is private. There is no getter for _fileSize, but I found getLength() which returns 0. Does anyone know whether getLength() should return the file size and why it does not? I currently get the file size from the backend document using getDocument(true) to update the NotesDocument with the attachment but this has other side effects. If I return from my button and upload another file then getDocument(true) raises a NullPointerException. Any advice is appreciated. It works if I replace the “return false” with a context.reloadPage() but then the other input data get lost. Any other ideas? Many thanks for any help.

By the way, I just noticed that the uploaded files are stored in http://server/path/database.nsf/xsp/.ibmmodres/persistence/DominoDoc-123-File/filename.pdf . I don’t know how to get in this path. Does anyone know when these files are deleted? I still have access to uploaded files which were never saved in real documents (by closing the browser before saving and after uploading files to the current document).