-
1. Re: File Upload Error in IE6
artmooney Dec 16, 2008 11:17 AM (in response to artmooney)This yield to the message 'Transfer error occured'. But the file has been uploaded. Is there a known workaround?
-
2. Re: File Upload Error in IE6
andrei_exadel Dec 16, 2008 1:38 PM (in response to artmooney)Which RF version do you use?
-
3. Re: File Upload Error in IE6
artmooney Dec 17, 2008 8:56 AM (in response to artmooney)It does not work in 3.2.2 or in latest 3.3.0 snapshot
-
4. Re: File Upload Error in IE6
mvitenkov Dec 17, 2008 10:48 AM (in response to artmooney)Issue was verified under following configuration: tomcat 6.16, JSF RI 1.2_10 with facelets, IE6, last richfaces 3.3.0-SNAPSHOT.
SSL connector have default view in server.xml:<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" />
File upload works fine for me.
Could you please, provide more information about this issue:
page code, java bean code, configuration files. -
5. Re: File Upload Error in IE6
artmooney Dec 18, 2008 3:13 AM (in response to artmooney)Environment
Latest RF 3.3.0
JSF RI 1.2_10
OC4J 10.1.3.3 on AIX via https
xhtml:
<ui:composition template="/layout/page_template.xhtml">
<ui:define name="content">
<h:outputText value="TODO Import" styleClass="moduleHeading" />
<rich:tabPanel id="importTabPanel" switchType="ajax" styleClass="detailsTab">
<rich:tab id="imports" label="TODO Anlegen" >
<a4j:form id="uploadForm">
<rich:fileUpload id="uploadCtrl"
binding="#{invoiceUpload.fileUploadUI}"
fileUploadListener="#{invoiceUpload.fileUploadListener}"
uploadData="#{invoiceUpload.uploadData}"
maxFilesQuantity="3"
immediateUpload="false"
allowFlash="false" >
<!-- <a4j:support event="onuploadcomplete" reRender="importControls" /> -->
</rich:fileUpload>
</a4j:form>
<rich:spacer height="10px" />
<a4j:form>
<a4j:outputPanel id="importControls" layout="none">
<a4j:commandButton id="importBtn" rendered="#{invoiceUpload.readyForImport}" value="TODO Import"
actionListener="#{invoiceUpload.importInvoices}" />
</a4j:outputPanel>
</a4j:form>
</rich:tab>
...
Bean
@Controller("invoiceUpload")
@Scope("conversation.access")
public class InvoiceUploadBean extends MECBean
{
private Log log = LogFactory.getLog(getClass());
private List uploadData = new LinkedList();
private List imports;
private boolean readyForImport = true;
private HtmlFileUpload fileUploadUI;
private String reportUrl;
@Autowired
private ImportInvoiceDAOToplinkImpl importDAO;
private void loadData()
{
imports = importDAO.findProcessesBySupplier(getGLN(), getCountryCode(), "I");
}
@HandleException
public void forceReload(ActionEvent event)
{
loadData();
}
@HandleException
public void importInvoices(ActionEvent event)
{
log.debug("importInvoices");
List tmp = new LinkedList();
for ( UploadItem upload : uploadData ) {
ImportInvoiceVO vo = new ImportInvoiceVO();
vo.setFileData(upload.getData());
vo.setSize(upload.getFileSize());
tmp.add(vo);
}
for ( ImportInvoiceVO vo: tmp ) {
try {
Long id = importDAO.importInvoice(vo, getGLN(), getCountryCode());
StringBuilder builder = new StringBuilder();
builder.append( getI18n().get("1.5001").toString() );
builder.append(" " + id + " ");
builder.append( getI18n().get("2.5001").toString() );
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, builder.toString(), "");
FacesContext.getCurrentInstance().addMessage(event.getComponent().getId(), msg);
}
catch (Exception ex) {
StringBuilder builder = new StringBuilder();
builder.append( getI18n().get("1.5002").toString() );
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, builder.toString(), ex.getLocalizedMessage());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
}
public void fileUploadListener(UploadEvent event)
throws Exception
{
for ( UploadItem upload : uploadData ) {
log.debug("Uploaded file is : " + upload.getFileName() );
}
if ( uploadData.size() > 0 ) {
readyForImport = true;
}
}
public void setUploadData(List<org.richfaces.model.UploadItem> uploadData)
{
this.uploadData = uploadData;
}
public List<org.richfaces.model.UploadItem> getUploadData()
{
return uploadData;
}
public boolean getReadyForImport()
{
return readyForImport;
}
public void setReadyForImport(boolean readyForImport)
{
this.readyForImport = readyForImport;
}
public List getImports()
{
if ( imports == null )
loadData();
return imports;
}
public void setImports(List imports)
{
this.imports = imports;
}
public HtmlFileUpload getFileUploadUI()
{
return fileUploadUI;
}
public void setFileUploadUI(HtmlFileUpload fileUploadUI)
{
this.fileUploadUI = fileUploadUI;
}
public String getReportUrl()
{
return reportUrl;
}
public void setReportUrl(String reportUrl)
{
this.reportUrl = reportUrl;
}
}
Config
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="EDI" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>EDI</display-name>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<!-- General JSF configuration -->
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-components-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<!-- richfaces configuration -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>metrolink</param-value>
</context-param>
<!-- facestrace config-->
<context-param>
<param-name>com.prime.facestrace.DISABLE_TRACE</param-name>
<param-value>true</param-value>
</context-param>
<!-- log4j configuration -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>createTempFiles</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>maxRequestSize</param-name>
<param-value>1000000</param-value>
</init-param>
<filter-name>RequestContext</filter-name>
<filter-class>de.mgi.mec.fw.util.request.RequestContextFilter</filter-class>
<!-- AuthenticationFilter & SSO configuration -->
<filter-name>AuthenticationFilter</filter-name>
<filter-class>de.mgi.mec.webapp.security.AuthenticationFilter</filter-class>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
REQUEST
FORWARD
INCLUDE
</filter-mapping>
<filter-mapping>
<filter-name>RequestContext</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
<servlet-name>ErrorHandlerServlet</servlet-name>
<servlet-class>de.mgi.mec.webapp.errorhandling.ErrorHandlerServlet</servlet-class>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>2</load-on-startup>
<servlet-mapping>
<servlet-name>ErrorHandlerServlet</servlet-name>
<url-pattern>/errorhandler</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/faces/mecLogin.jsf</welcome-file>
</welcome-file-list>
<error-page>
<error-code>500</error-code>
/faces/error.xhtml
</error-page>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app> -
6. Re: File Upload Error in IE6
artmooney Dec 18, 2008 5:48 AM (in response to artmooney)This seems to be a problem with redirecting.
With direct access to the server everything works.
Direct url is http://iappl1-1-dev.mgi.de:9910/mec/
Redirect is http://mec-dev.metro-link.com/mec/
When using the redirect the upload fails.
Regards,
Bernd -
7. Re: File Upload Error in IE6
artmooney Dec 22, 2008 4:44 AM (in response to artmooney)Any suggestions how to solve this problem? What is the main difference between the file upload and all other ajax submissions, that could explain the problem.
The redirect is a NAT done by a BigIP F5 device.
Bernd -
8. Re: File Upload Error in IE6
nbelaevski Dec 22, 2008 9:17 AM (in response to artmooney)Hello Bernd,
I'm getting the following accessing http://mec-dev.metro-link.com/mec/ :
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: http://mec-dev.metro-link.com/mec/
The following error was encountered:
* Connection to 164.139.15.56 Failed
The system returned:
(60) Connection timed out
The remote host or network may be down. Please try the request again.
Uploading files is done using common form submission if Flash is not enabled and by Flash itself if it is enabled. I recommend to try to switch Flash on and off ('allowFlash' attribute) and check.