|Title|File upload issue
|Date|26-Jan-2007 17:18:24 EET
|Version|2.0.52
|Submitter|203.99.197.2
|[Bug criticality]|MediumBug
|Browser version|IE
|[Bug status]|ClosedBug
|[PageProvider] used|
|Servlet Container|Tomcat 5.5
|Operating System|Windows
|URL|~UploadTemplate.jsp
|Java version|1.4.2

Hi, 
I have developed a wiki based web application and hosted in internet. When I try to upload any documents using the upload option, sometimes I am getting a error like, "java.io.IOException: Stream ended prematurely."
But upload works fine if I access the application directly in the server without accessing via internet. I have no cule where the problem is. Is it a problem with the internet bandwidth or firewall issue? Please help me resloving the issus. Thanks.


Stack Trace:
------------
{{{
2007-01-26 15:42:51,179 [TP-Processor7] WARN com.ecyrd.jspwiki.attachment.AttachmentServlet  - Upload failure: Stream ended prematurely. (attachment: (unknown))
java.io.IOException: Stream ended prematurely.
	at http.utils.multipartrequest.MultipartRequest.readParameter(MultipartRequest.java:909)
	at http.utils.multipartrequest.MultipartRequest.parse(MultipartRequest.java:760)
	at http.utils.multipartrequest.MultipartRequest.initParser(MultipartRequest.java:506)
	at http.utils.multipartrequest.MultipartRequest.<init>(MultipartRequest.java:386)
	at com.ecyrd.jspwiki.attachment.AttachmentServlet.upload(AttachmentServlet.java:288)
	at com.ecyrd.jspwiki.attachment.AttachmentServlet.doPost(AttachmentServlet.java:211)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
	at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
	at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Unknown Source)
}}}

----

I'm almost certain this is either browser-dependent or proxy-dependent.  Downgrading this to MediumBug, since it does not appear every time.

-- JanneJalkanen

----
It seems its the problem with the IIS server we have integrated with tomcat for providing authentication. the upload works fine after we removed the IIS. But is there a way to provide windows authentication to the application?

Regards,
Guru


----

Yes there is, have a look at [NTLM Authentication]

--HarryMetske, 05-Feb-2007

----
I have made the changes in web.xml and NTLM Authentication works well in intranet. But not working in iternet. is there anything else I need to do to make it work in internet?

----
Can you elaborate on the details involved into uploading to the JSPWiki site from an internet host? 
* Are the files uploaded rather large? 
* Are there any firewalling / filtering mechanisms in place between the tomcat and the uploading client? 
* What sort of internet connection does the upload client make use of?
* Do you have  disableUploadTimeout set to "true" in the configuration of your tomcat default HTTP connector? This is an option that stopped one of my SwA web services from working some time ago...

--''[Kristian Rink]'' @ 27.02.07 09:09:22


----

No answer from bug reporter after a month, closing bug.....

--HarryMetske