EasyUploads
Use file uploads as fields in Form, upload multiple files at once - easily!
The default Upload component in Vaadin is a powerful tool, but its rather low level API is sometimes hard to use for simple tasks.
EasyUploads add-on contains wrappers to simplify usage of the Upload component.
UploadField provides easier API for developer to access the uploaded file contents or the File object where the contents was streamed. It also implements full Field API, making it possible to use it with automatic data binding using Binder to properties of type byte[].
ImagePreviewField an extension of the above to store an image to byte array (e.g. Lob in DB) and which provides built in preview for the image.
MultiFileUpload is a helper for uploading multiple files. When a file is selected by the end user the upload is immediately started and MultiFileUpload is ready to select another file (while previous one(s) are still being uploaded). Since 0.2 one can also select multiple files with the OS dialog or by dragging files from OS to a "drop zone". Since 0.3 (0.4 for IE) users can also select multiple files at once using the OS dialog (aka. ctrl/shift-click).
Both components contain built in support for ProgressIndigator, giving nice feedback for end user without requiring boiler plate code from Vaadin developer.
This is an open source product. All contributions (code, documentation, tutorials, bug reports, enhancement suggestions) are more than welcome. Use the project page for contributions, Vaadin forum or Pro Account for help requests.
Note that the addon version 8.0.x needs Vaadin 7 compatibility code as well. Thus, you'll need to add following dependency as well (not required from 9.0.0 forward):
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-client</artifactId>
<scope>provided</scope>
</dependency>
Sample code
final UploadField uploadField = new UploadField(); Button b = new Button("Show value"); b.addListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { byte[] value = uploadField.getValue(); mainWindow.showNotification("Value:" + value); } });
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Fixed compilation problem with GWT 2.3 (Vaadin 6.6). Also added IE9 support.
- Released
- 2011-05-12
- Maturity
- BETA
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 6.5+
- Vaadin 8.0+ in 9.0.0
- Vaadin 6.8+ in 0.5.3
- Vaadin 7.0+ in 7.4.10
- Vaadin 6.6+ in 0.4.9
- Vaadin 6.0+ in 0.5.2
- Browser
- Browser Independent
EasyUploads - Vaadin Add-on Directory
Use file uploads as fields in Form, upload multiple files at once - easily!Discussion Forum
Usage examples
V7 version sources
EasyUploads version 0.1.0
Initial release.
EasyUploads version 0.2.0
* MultiFileUpload: Drag and drop and multiple selection via OS dialog in Safari, Chorme and FF (with latest stable versions)
* dependency to 6.5.0 nightly (brings eg. bettter portlet support)
EasyUploads version 0.3.0
This version works with vaadin 6.5 nightly since revision [15850]
Earlier versions can be used with 6.5 (0.2) and 6.4 (0.1)
EasyUploads version 0.3.1
Modified to support vaadin 6.5 nightly since revision [15973]
0.3.0:
This version works with vaadin 6.5 nightly since revision [15850]
Earlier versions can be used with 6.5 (0.2) and 6.4 (0.1)
EasyUploads version 0.4.0
0.4.0
Selection of multiple files with IE now possible via flash fallback (swfupload).
0.3.1:
Modified to support vaadin 6.5 nightly since revision [15973]
0.3.0:
This version works with vaadin 6.5 nightly since revision [15850]
Earlier versions can be used with 6.5 (0.2) and 6.4 (0.1)
EasyUploads version 0.4.1
0.4.1
Does not throw exception when trying to set read through in UploadField. Instead silently ignores.
0.4.0
Selection of multiple files with IE now possible via flash fallback (swfupload).
0.3.1:
Modified to support vaadin 6.5 nightly since revision [15973]
0.3.0:
This version works with vaadin 6.5 nightly since revision [15850]
Earlier versions can be used with 6.5 (0.2) and 6.4 (0.1
EasyUploads version 0.4.2
Fixed issues when calling discard in buffered mode (memory buffer).
0.4.1:
Does not throw exception when trying to set read through in UploadField. Instead silently ignores.
0.4.0:
Selection of multiple files with IE now possible via flash fallback (swfupload).
0.3.1:
Modified to support vaadin 6.5 nightly since revision [15973]
0.3.0:
This version works with vaadin 6.5 nightly since revision [15850]
Earlier versions can be used with 6.5 (0.2) and 6.4 (0.1
EasyUploads version 0.4.3
0.4.3
Added setButtonCaption method for UploadField
0.4.2:
Fixed issues when calling discard in buffered mode (memory buffer).
0.4.1:
Does not throw exception when trying to set read through in UploadField. Instead silently ignores.
0.4.0:
Selection of multiple files with IE now possible via flash fallback (swfupload).
0.3.1:
Modified to support vaadin 6.5 nightly since revision [15973]
0.3.0:
This version works with vaadin 6.5 nightly since revision [15850]
Earlier versions can be used with 6.5 (0.2) and 6.4 (0.1
EasyUploads version 0.4.4
MultiFileUpload: Removed limitation of file types in IE's flash fallback.
MultiFileUpload: attach-detach-attach no more adds duplicate "dropzones"
Removed obsolete debug code
Depends to soon to be released 6.5.5 (works with latest nightlies)
0.4.3
Added setButtonCaption method for UploadField
0.4.2:
Fixed issues when calling discard in buffered mode (memory buffer).
0.4.1:
Does not throw exception when trying to set read through in UploadField. Instead silently ignores.
0.4.0:
Selection of multiple files with IE now possible via flash fallback (swfupload).
0.3.1:
Modified to support vaadin 6.5 nightly since revision [15973]
0.3.0:
This version works with vaadin 6.5 nightly since revision [15850]
Earlier versions can be used with 6.5 (0.2) and 6.4 (0.1
EasyUploads version 0.4.5
Fixed compilation problem with GWT 2.3 (Vaadin 6.6). Also added IE9 support.
EasyUploads version 0.4.7
Fixed multiupload visibility issue in Opera + some other minor bugfixes and cleaning
EasyUploads version 0.4.8
Both dragging and selecting in MultiFileUpload now works similarly (deletes files after handleFile() method is called). Also made FileBuffer configurable so that files may be kept although the buffer value is changed.
EasyUploads version 0.4.9
* Buttons in IE and Opera now looks the like other Vaadin buttons.
* Caption in multifileupload can now be modified
EasyUploads version 0.5.0
Features and bug fixes by Jeff Zhu:
* Classic style for UploadField
* Support max upload size in bytes
* The upload component in UploadField should be invisible during upload
* fixed issue with progressbar in UploadField
EasyUploads version 0.5.1
Setting immediate now does not revert button caption in UploadField. Happens easily in with e.g. Visual Designer
EasyUploads version 0.5.2
Several improvements contributed by "StEwert.con"
EasyUploads version 7.0.0
V7 compatible version of the add-on. Contains previous features and new client side file type and size filter for html5 capable browsers (extension + api in UploadField).
EasyUploads version 0.5.3
Some enhancements and API openings by Joonas Kekoni for V6 branch.
EasyUploads version 7.0.1
Removed usage of elemental API -> compiles all browser permutations without special tricks.
EasyUploads version 7.2.0
Fixes some bizarre issues with Chrome, fixed by Teemu Pöntelin.
Fixes compatibility with Vaadin 7.2
EasyUploads version 7.2.2
Fixed a XSS vulnerability
EasyUploads version 7.3.3
Fixed NPE issues with empty fields (thanks to contributors!) and fixed theme to be more compatible with Valo.
EasyUploads version 7.4.0
Fixed compatibilities with 7.4.0 release and Valo theme
EasyUploads version 7.4.1
Fixed broken "auto commit" for byte[] types, probably regression since V7 upgraded
EasyUploads version 7.4.2
Avoid possibly mixing file names and some other enhancements. See project page for changes.
EasyUploads version 7.4.6
Yet another set of improvements by Anna via sponsored add-on development. See github timeline for all recent changes.
EasyUploads version 7.4.10
null
EasyUploads version 8.0.0
First Vaadin 8 compatible version. Further versions will aim to add support for HasField support (needed for Vaadin 8 Binder usage).
EasyUploads version 9.0.0
First version that don't require Vaadin 7 compatibility package. Some versions might be missing -> consider using 8.0.x series, which depends on vaadin 7 compatibility packages if those are vital. In any case, report issues and missing features to the github project page.