Hej Milos I am also from Serbia (well I have moved now) but I have graduate
from the FON (since you are using the tapestry and if you are on them
faculty then I know your professor - personally)

I will give you some example code so that you can figure things out and if
you need more help feel free to reach out.

So what you need is in your .tml

 <t:form t:id="form">
    <input t:type="upload" t:value="uploadImage" />
                                  
 </t:form>

in your java file you would then have

    @Inject
    private ApplicationGlobals appGlobals;
    @Property
    private UploadedFile uploadImage;


    @OnEvent(value = EventConstants.SUCCESS, component = "form")
    void processForm() {

                if (uploadImage!= null) {
                    String fileName = uploadImage.getFileName());
                    File copied = new
File(appGlobals.getServletContext().getRealPath("/images/") + "/" +
fileName);
                    uploadImage.write(copied);
                } 
    }

So above you check if the file is uploaded and then u get the name, and move
the file to a location where you want it

Hope this gives you a simpel example to try it out

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Uploading-Images-tp5639019p5639912.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to