-
1. Re: New fileUpload component
svadu Jan 22, 2007 3:21 PM (in response to shane.bryzak)Nice! And may be even just in time :)
-
2. Re: New fileUpload component
shane.bryzak Jan 22, 2007 8:27 PM (in response to shane.bryzak)One more thing I forgot to mention - the form tag needs to set the encoding type to multipart/form-data:
<h:form enctype="multipart/form-data"> ... </h:form>
-
3. Re: New fileUpload component
ask4saif Jan 23, 2007 5:52 AM (in response to shane.bryzak)Dear shane,
Nice work, how can i download and embed your work in my current seam package. can you send me the link please.
thank you in advance -
4. Re: New fileUpload component
pmuir Jan 23, 2007 5:55 AM (in response to shane.bryzak)You need to grab a copy of Seam from CVS
-
5. Re: New fileUpload component
ask4saif Jan 23, 2007 6:52 AM (in response to shane.bryzak)Dear petemuir,
i know i need to grab a copy of seam from cvs. can you tell me how to get a copy from cvs. that i want to know. please guide me to the cvs.
I will be very thankful to you. -
6. Re: New fileUpload component
pmuir Jan 23, 2007 6:56 AM (in response to shane.bryzak)The wiki is your friend :)
http://wiki.jboss.org/wiki/Wiki.jsp?page=CVSRepositoryexport CVSROOT=:pserver:anonymous@anoncvs.forge.jboss.com:/cvsroot/jboss cvs co jboss-seam cd jboss-seam ant dist cd ../jboss-seam-1.1.1.GA/
-
7. Re: New fileUpload component
gus888 Jan 23, 2007 10:11 AM (in response to shane.bryzak)Hi,
This fileUpload component is very easy to use, but I am wondering how to get the uploaded file properties, e.g. type, name. Thank you. -
8. Re: New fileUpload component
gavin.king Jan 23, 2007 2:07 PM (in response to shane.bryzak)This fileUpload component is very easy to use, but I am wondering how to get the uploaded file properties, e.g. type, name. Thank you.
Shane added that last night. It looks like:<s:fileUpload data="#{component.bytes}" contentType="#{component.type}" fileName="#{component.name}"/>
-
9. Re: New fileUpload component
gus888 Jan 23, 2007 5:48 PM (in response to shane.bryzak)Very nice. This will be very easy to value-bind file with entity bean. Thank you so much.
-
10. Re: New fileUpload component
msystems Jan 26, 2007 5:51 AM (in response to shane.bryzak)I'm using JSF 1.1 RI and the file upload component doesn't work.
It will work just fine if I include the following lines of code in the FileUpload.decode():if (request instanceof HttpServletRequestWrapper) { // Needed for JSF 1.1 RI request = ((HttpServletRequestWrapper) request).getRequest(); }
FileUpload.decode():@Override public void decode(FacesContext context) { super.decode(context); Object request = context.getExternalContext().getRequest(); if (request instanceof HttpServletRequestWrapper) { // Needed for JSF 1.1 RI request = ((HttpServletRequestWrapper) request).getRequest(); } if (request instanceof MultipartRequest) { MultipartRequest req = (MultipartRequest) request; String clientId = getClientId(context); byte[] fileData = req.getFileBytes(clientId); String contentType = req.getFileContentType(clientId); String fileName = req.getFileName(clientId); getValueBinding("data").setValue(context, fileData); ValueBinding vb = getValueBinding("contentType"); if (vb != null) vb.setValue(context, contentType); vb = getValueBinding("fileName"); if (vb != null) vb.setValue(context, fileName); } }
Regards
Kenneth -
11. Re: New fileUpload component
shane.bryzak Jan 26, 2007 5:01 PM (in response to shane.bryzak)Thanks Kenneth, I've added these extra lines.
-
12. Re: New fileUpload component
poyge394 Jan 30, 2007 9:17 AM (in response to shane.bryzak)witch exampel project is it ?
is it seamspace ? -
13. Re: New fileUpload component
shane.bryzak Jan 30, 2007 4:28 PM (in response to shane.bryzak)Yes, seamspace uses the new fileUpload control.
-
14. Re: New fileUpload component
ask4saif Feb 5, 2007 5:37 AM (in response to shane.bryzak)Dear Shane I have used this component of yours and its working fine.
Can you please tell me, how can we regenerate the saved images in the database to our front end in JSF. Currently i have tried it as:<h:graphicImage id="image" url="#{hotel.image}"> </h:graphicImage>
but it is not displaying the image, can you please help me in this matter.
Thank you very much
cheers