Permalink
Browse files

added samples for grails-file-uploader 1.1

  • Loading branch information...
1 parent b32761e commit ea1f255111804305f8e361fb59d30a16b154fe6f @lucastex lucastex committed Jul 26, 2009
View
@@ -1,8 +1,8 @@
#utf-8
-#Fri Jul 24 17:34:54 BRT 2009
+#Sun Jul 26 14:49:08 BRT 2009
app.grails.version=1.2-M1
app.name=grails-file-uploader-sample
app.servlet.version=2.4
app.version=0.1
-plugins.file-uploader=1.0
-plugins.hibernate=1.2-M1
+plugins.file-uploader=1.1
+plugins.hibernate=1.1.1
@@ -65,6 +65,8 @@ log4j = {
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate'
+
+ debug 'grails.app'
warn 'org.mortbay.log'
}
@@ -3,6 +3,13 @@ import com.lucastex.grails.fileuploader.UFile
class AvatarController {
def index = {
- [files: UFile.list()]
+ log.debug "Uploaded file with id=${params.ufileId}"
+ [files: UFile.list(), params:params]
+ }
+
+ def delete = {
+ def ufile = UFile.get(params.id)
+ ufile.delete()
+ redirect action:index
}
}
@@ -3,6 +3,13 @@ import com.lucastex.grails.fileuploader.UFile
class DocsController {
def index = {
- [files: UFile.list()]
+ log.debug "Uploaded file with id=${params.ufileId}"
+ [files: UFile.list(), params:params]
+ }
+
+ def delete = {
+ def ufile = UFile.get(params.id)
+ ufile.delete()
+ redirect action:index
}
}
@@ -27,7 +27,7 @@
</tr>
<tr>
<td><b>Size</b></td>
- <td>${f.size}</td>
+ <td><fileuploader:prettysize size="${f.size}" /> (${f.size})</td>
</tr>
<tr>
<td><b>Extension</b></td>
@@ -47,7 +47,12 @@
<fileuploader:download id="${f.id}"
errorAction="index"
errorController="avatar">Click here to download</fileuploader:download></td>
- </tr>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <g:link controller="avatar" action="delete" id="${f.id}">Click here to delete</g:link></td>
+ </tr>
</table>
</g:each>
</p>
@@ -27,7 +27,7 @@
</tr>
<tr>
<td><b>Size</b></td>
- <td>${f.size}</td>
+ <td><fileuploader:prettysize size="${f.size}" /> (${f.size})</td>
</tr>
<tr>
<td><b>Extension</b></td>
@@ -47,6 +47,11 @@
<fileuploader:download id="${f.id}"
errorAction="index"
errorController="docs">Click here to download</fileuploader:download></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <g:link controller="docs" action="delete" id="${f.id}">Click here to delete</g:link></td>
</tr>
</table>
</g:each>

0 comments on commit ea1f255

Please sign in to comment.