There are some bugs lurking in the interaction between the ajax4jsf components and s:fileUpload. First and simplest, putting an a:support inside a s:fileUpload component doesn't do anything. Second, this code:
<a:form id="uploadForm" enctype="multipart/form-data"> <h:outputLabel for="file">Give us a file!</h:outputLabel> <s:fileUpload id="file" data="#{uploadTest.inputStream}" accept="image/jpeg,image/png" fileName="#{uploadTest.fileName}" contentType="#{uploadTest.contentType}" /> <h:commandButton id="save" value="Do it" action="#{uploadTest.upload}"/> <a:commandButton action="#{uploadTest.upload}" value="Do it AJAX-style" reRender="uploadForm"/> </a:form>
I found this thread:
http://jboss.com/index.html?module=bb&op=viewtopic&t=105534
Ouch.
I'm going to do this the sane and easy way, which is to use an applet.