Last updated by Wuestenfuchs 10 months ago
grails install-plugin jquery-file-upload
Last updated by munih 10 months ago
Provides common resources for http://aquantum-demo.appspot.com/file-upload and helper tags.
To add basic jquery plugin resources, add the tag <jqfu:resources tmpl=”false” /> tag to the HEAD of your template. And place <jqfu:resources url=”_URL_” /> in the content of your view. The url parameter specify the action URL that actually stores the file in your app. It must return an JSON collection of a maps for each file stored. A returned file map must return at least the file name and file size of the sorted file. For example:
def upload = {
Collection result = []
Binary binary
request.getFileNames().each {
binary = Binary.storeMyFileMethod(request.getFile(it))
result << [name: binary.getFileName(), size: binary.getFileSize()]
}
render result as JSON
}The jQuery File Upload plugin uses the the jQuery.tmpl plugin to render the user actions. In the above example we turned the jQuery template engine off as the plugin provided an js rendering extension to work out of the box. If you set the “tmpl” parameters in the resources tag, the jQuery.tmpl plugin will be added and you must create your own jquery template.
See http://aquantum-demo.appspot.com/file-upload for more details.
Last updated by admin 10 months ago
Last updated by admin 10 months ago