View Full Version : Validation of uploaded files
ShurikAg
Feb 23rd, 2011, 02:27 PM
I was trying o find a proper way how to validate uploaded file types in a form.
Is there any documentation or example of how to do it properly? I mean including the mime type...
Thanks,
pledbrook
Feb 25th, 2011, 05:31 AM
The 'save' action in ScreencastController (https://svn.codehaus.org/grails-plugins/grails-screencasts/trunk/grails-app/controllers/org/grails/screencasts/ScreencastController.groovy) verifies the file type of an upload. Perhaps the same sort of thing will work for you.
ShurikAg
Feb 25th, 2011, 03:55 PM
The 'save' action in ScreencastController (https://svn.codehaus.org/grails-plugins/grails-screencasts/trunk/grails-app/controllers/org/grails/screencasts/ScreencastController.groovy) verifies the file type of an upload. Perhaps the same sort of thing will work for you.
hmmm....
Yes it does...
But i was looking for something like constraint configuration to validate the files. Because it might bi different in different cases and I don't think that having exactly the same code (with just small changes) in controllers.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.