doc is not a valid xfa command (that is an AcroForm command). To get to the doc object in xfa you must use event.target. So your command woudl be:
var filestoget = event.target.documentFileName;
Or if you prefer:
var oDoc = event.target;
var filetoget = oDoc.documentFileName;