To be able to import a file programmatically you have to certify the document (a form of signing). If the form is not signed then you will only be able to use xfa.host.importData() and a dialog will come up and allow the user to choose the file to import. To be able to certify a Reader Extended form digital signatures must be enabled through Reader Extensions as well.