Rob Audenaerde
Rob Audenaerde

Reputation: 20019

How to upload a screenshot/image using Wicket

I want user to be able to easily upload screenshots into my application. (preferably without to many js/ajax trickery)

Is there a standard way in Wicket to allow an image to be pasted in some FormComponent (textarea? div with contenteditable?) and used as a regular input, so that when the form is posted, I get a byte[]/stream in the Java code?

Upvotes: 0

Views: 213

Answers (1)

martin-g
martin-g

Reputation: 17513

You have to use <input type="file"> in the markup and FileUpload component at the Java/server code.

If you need fancier ways than Upload button than you will need to use some Javascript library.

Here is the plain Wicket example

If you use Bootstrap then you may use Wicket-Bootstrap integrations like FileInput or DropZone

Upvotes: 2

Related Questions