1 2 Previous Next 25 Replies Latest reply on Feb 23, 2007 2:03 AM by newlukai Go to original post
      • 15. Re: New fileUpload component
        smokingapipe

        Cool, a file upload component! One small comment: there should be a way to apply a Converter to this. What does this mean? Very often files are very big, and should be streamed straight to disk or processed in some way (image resized) before being put into a byte array. For example, Java 2d has some pretty efficient ways of resizing an image from a InputStream. I'm just wondering how well these byte[] will do for files that are 100mb or so. Maybe they'll be fine in these days of every machine having > 1gb of RAM. You would just have to make sure to allocate enough RAM to the JVM.

        • 16. Re: New fileUpload component
          pmuir

          Yes, this is a good idea (for images at least) - other interesting things you can do:

          * adjust the image ratio (put transparent bars around
          it)
          * scale it
          * adjust it's quality
          * convert it between formats (e.g. upload as bmp, save as png)

          Further, you can apply a validator (e.g. reject the image if it is over 800x600)

          Add a feature request to JIRA (but I don't know if it will be done anytime soon).

          http://jira.jboss.org/jira/browse/JBSEAM-705

          • 17. Re: New fileUpload component
            ask4saif

            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

            • 18. Re: New fileUpload component
              shane.bryzak

              Over this last weekend I completely rewrote the file upload component, and one of the improvements is the ability to stream the upload to a temp file on disk. Plus you can now also bind the file data to either a byte[] or InputStream property - so what this means, is that if you use this option it should be very resource efficient (it streams using only a 2k buffer). This only exists in cvs at the moment, and I haven't had a chance to document this yet - if you want to try it out you need to set the createTempFiles filter property to true, ie:

               <filter>
               <filter-name>Seam Multipart Filter</filter-name>
               <filter-class>org.jboss.seam.servlet.SeamMultipartFilter</filter-class>
               <init-param>
               <param-name>createTempFiles</param-name>
               <param-value>true</param-value>
               </init-param>
               </filter>
              


              Can you please tell me, how can we regenerate the saved images in the database to our front end in JSF.


              Check out the seamspace demo, it does exactly this and also supports dynamic resizing of the image. This is done using a servlet (see ContentServlet.java) in conjunction with SeamServletFilter for creating the necessary Seam contexts.



              • 19. Re: New fileUpload component
                ask4saif

                Dear shane,

                thanks for your help, I will see the example. Hope It will do fine for me.

                thanks again

                • 20. Re: New fileUpload component
                  gus888

                   

                  "petemuir" wrote:
                  Yes, this is a good idea (for images at least) - other interesting things you can do:

                  * adjust the image ratio (put transparent bars around
                  it)
                  * scale it
                  * adjust it's quality
                  * convert it between formats (e.g. upload as bmp, save as png)

                  Further, you can apply a validator (e.g. reject the image if it is over 800x600)

                  Add a feature request to JIRA (but I don't know if it will be done anytime soon).

                  http://jira.jboss.org/jira/browse/JBSEAM-705

                  Peter, Thank you for adding the wonderful features. In addition, may you add the s:dynamicImage to JIRA? In the SeamSpace example, the dynamic images were displayed in servlets. I am wondering why they didn't use my:dynamicImage of Seam wiki. Servlets is better than my:dynamicImage? Thank you.

                  • 21. Re: New fileUpload component
                    pmuir

                    Sorry, no, these aren't features which are added, they are ideas for features which could be added!

                    I think the issue of resource loading has to be addressed in Seam (I need to find some time to start a thread on it), so as a result I don't think dynamicImage should go into core as it is - anyway, its easy enough to just slot it into your project as it is :)

                    • 22. Re: New fileUpload component
                      kaolle

                      I'm somewhat new to the Java domain, so I wonder if you have any sample how to stream the stored blob content?

                      I suppose I need to checkout the latest and greatest from CVS to take advantage if this feature, which source files do I need to check out, or is the only option to checkout all?

                      "shane.bryzak@jboss.com" wrote:
                      Over this last weekend I completely rewrote the file upload component, and one of the improvements is the ability to stream the upload to a temp file on disk. Plus you can now also bind the file data to either a byte[] or InputStream property - so what this means, is that if you use this option it should be very resource efficient (it streams using only a 2k buffer). This only exists in cvs at the moment, and I haven't had a chance to document this yet - if you want to try it out you need to set the createTempFiles filter property to true, ie:

                       <filter>
                       <filter-name>Seam Multipart Filter</filter-name>
                       <filter-class>org.jboss.seam.servlet.SeamMultipartFilter</filter-class>
                       <init-param>
                       <param-name>createTempFiles</param-name>
                       <param-value>true</param-value>
                       </init-param>
                       </filter>
                      


                      Can you please tell me, how can we regenerate the saved images in the database to our front end in JSF.


                      Check out the seamspace demo, it does exactly this and also supports dynamic resizing of the image. This is done using a servlet (see ContentServlet.java) in conjunction with SeamServletFilter for creating the necessary Seam contexts.



                      • 23. Re: New fileUpload component

                        Hi,

                        is this upload tag compatible with ICEfaces? Or should the ICEfaces fileUpload be used?

                        Regards
                        Newlukai

                        • 24. Re: New fileUpload component
                          henrik.lindberg

                          Newlukai, unless I am misinformed - if you use ICEFaces 1.5.3, and Seam 1.1.6GA neither the ICEFAces file upload, nor the Seam upload works. This is logged as an issue in Jira

                          • 25. Re: New fileUpload component

                            That's not so good. At the moment I use Seam 1.1.5.GA and ICEfaces 1.5.3 and I'm using the ICEfaces upload component. I've not completed the upload feature for my application, but right now, the uploaded file is placed in the deployment directory and I retrieve an InputFile object with the path to this file.
                            So I think I'll use this until ICEfaces and Seam work together ;)

                            1 2 Previous Next