Use File Upload Control w/o Binding it to Datasource

I’m trying to use XPages without explicitly binding the fields to the underlying form datasource (instead, I’m using scoped variables.) In the onClick event of my “Save” button, I have the following code to create a document:

var docObj:NotesDocument = null;

docObj = database.createDocument();

docObj.replaceItemValue(“itemName”, itemName.toUpperCase());

docObj.replaceItemValue(“itemDescription”, requestScope.itemDescriptionVar);

docObj.replaceItemValue(“submittedBy”, getComponent(“submittedBy”).getValue());

docObj.replaceItemValue(“submittedOn”, getComponent(“submittedOn”).getValue());

docObj.replaceItemValue(“contactName”, requestScope.contactName);

docObj.replaceItemValue(“form”, “fMain”);

docObj.save();

It works fine, but how can I extend it to also include the file that the user selected from the File Upload control and save it like I did above with the other fields?

Subject: I don’t think you can do that…

I know you can’t get a handle to the full path and filename selected, and I don’t think you can get the file itself either. You may have to save to a temp doc, copy the rtitem contents to your fMain doc and then remove the temp doc.