Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.0.4
-
Component/s: Controllers
-
Labels:None
-
Environment:jdk 1.6, grails 1.0.4, windows xp, firefox 3.0.4
Description
I upgrade my project from grails 1.0.3 to 1.0.4, but it failed in uploading files. I have to revert back to 1.0.3.
The bug can be reproduced as follow:
gsp:
Upload Form: <br/>
<g:form method="post" enctype="multipart/form-data">
<input type="file" name="file"/>
<input type="submit"/>
</g:form>
controller:
def index = {
if (!params.file) return
def f=request.getFile('file')
if (!f.empty)
else
{ render 'null file' }}
This controller sometimes returns 'transfer ok', but if you try more times, it throws exception:
Error 200: java.lang.IllegalStateException: File has already been moved - cannot be transferred again
Servlet: grails
URI: /testuf/grails/uploader/index.dispatch
Exception Message: File has already been moved - cannot be transferred again
Caused by: java.lang.IllegalStateException: File has already been moved - cannot be transferred again
Class: UploaderController
In fact, the controller call transferTo() only once. Why the file is moved?
-
Hide
- testuf.zip
- 05/Dec/08 10:48 PM
- 144 kB
- James Lau
-
- testuf/.classpath 6 kB
- testuf/.project 0.5 kB
- testuf/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- testuf/application.properties 0.1 kB
- testuf/build.xml 1 kB
- testuf/grails-app/conf/BootStrap.groovy 0.1 kB
- testuf/grails-app/conf/Config.groovy 3 kB
- testuf/grails-app/conf/DataSource.groovy 0.6 kB
- testuf/grails-app/.../resources.groovy 0.0 kB
- testuf/grails-app/.../UrlMappings.groovy 0.2 kB
- testuf/.../UploaderController.groovy 0.3 kB
- testuf/grails-app/.../messages.properties 2 kB
- testuf/grails-app/.../messages_de.properties 3 kB
- testuf/grails-app/.../messages_es.properties 3 kB
- testuf/grails-app/.../messages_fr.properties 2 kB
- testuf/grails-app/.../messages_it.properties 2 kB
- testuf/grails-app/.../messages_ja.properties 2 kB
- testuf/grails-app/.../messages_nl.properties 3 kB
- testuf/.../messages_pt_BR.properties 3 kB
- testuf/grails-app/.../messages_ru.properties 4 kB
- testuf/grails-app/.../messages_th.properties 5 kB
- testuf/.../messages_zh_CN.properties 2 kB
- testuf/grails-app/views/error.gsp 2 kB
- testuf/grails-app/views/layouts/main.gsp 0.7 kB
- testuf/grails-app/.../uploader/index.gsp 0.3 kB
- testuf/testuf.iml 2 kB
- testuf/testuf.ipr 19 kB
- testuf/testuf.iws 28 kB
- testuf/testuf.launch 2 kB
- testuf/testuf.tmproj 2 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Probably another manifestation of the bug related to multipart forms, that I already reported and is now fixed.
If I start a new browser, sometimes the controller throws another exception:
[1149703] errors.GrailsExceptionResolver
java.lang.NullPointerException
at java.net.URLDecoder.decode(URLDecoder.java:119)