Yes, if I upload an empty file, I still get the same error with the same size
reported. And in my computer, a very simple page as follow can reproduce the
problem:

tml file(Start.tml):
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";> 
        <t:form t:id="form" >
                <t:errors />            
                <input t:type="upload" t:id="file" t:value="file" 
validate="required"/>
                <input type="submit" value="Upload"/>
        </t:form>
</html>

page class(Start.java):

package example.helloworld.pages;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.upload.services.UploadedFile;

public class Start {
        @Persist
        @Property
    private UploadedFile file;

        @Component
        private Form form;
                
        Object onActivate() {
                System.out.println("start ---");
                return true;
        }
                
        Object onUploadException(FileUploadException exception) {
                exception.printStackTrace();
                return this;
        }
        
    Object onSuccess()
    {
        System.out.println("[Info] on success: " + file.getFileName());         
        
        return this;   
    }
}

and I set the file size limit in the module(AppModule.java):

package example.helloworld.services;

import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.upload.services.UploadSymbols;

public class AppModule {
        public static void
contributeApplicationDefaults(MappedConfiguration<String, String>
configuration) {
                configuration.add(UploadSymbols.REQUESTSIZE_MAX, "2097153");
                configuration.add(UploadSymbols.FILESIZE_MAX, "2097153"); 
        }
}


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-rc3-upload-exception-tp4989904p4993504.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to