<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Messaggio</TITLE>
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=852352716-20042004><FONT face=Arial color=#0000ff size=2>Please
Help me and answer if anybody can</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=it dir=ltr align=left><FONT face=Tahoma
size=2>-----Messaggio originale-----<BR><B>Da:</B> Campione Aldo
[mailto:aldo.campione@siemens.com] <BR><B>Inviato:</B> luned́ 19 aprile 2004
10.26<BR><B>A:</B> opencms-dev@opencms.org<BR><B>Oggetto:</B> [opencms-dev]
UPLOAD FILES<BR><BR></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>Please can anybody help me
??</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>I use the following code to upload a file and it
works fine .......</SPAN></FONT></FONT></FONT><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=519282008-19042004></SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004><% </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>... </SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0><FONT face=Arial><FONT color=#0000ff><FONT
size=2><SPAN class=519282008-19042004> </SPAN> <SPAN
class=519282008-19042004> </SPAN></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004> </SPAN>Enumeration e =
cms.getRequestContext().getRequest().getFileNames();<BR> while
(e.hasMoreElements()) {<BR> <SPAN
class=519282008-19042004> String </SPAN>name =
(String)e.nextElement();<BR> <SPAN
class=519282008-19042004> </SPAN>byte[]
sourceByteArray =
cms.getRequestContext().getRequest().getFile(name);<BR> <SPAN
class=519282008-19042004> String
</SPAN>destFileName=<SPAN
class=519282008-19042004> "usr/share/uploads/ </SPAN> +
name;<BR><SPAN
class=519282008-19042004>
</SPAN>File nomefile=new File(destFileName);<BR> <SPAN
class=519282008-19042004>
</SPAN>FileOutputStream outFileStream=new
java.io.FileOutputStream(nomefile);<BR> <SPAN
class=519282008-19042004>
</SPAN>outFileStream.write(sourceByteArray);<BR> }<BR><SPAN
class=519282008-19042004> </SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT><FONT
size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>...</SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>%> </SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004></SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>.... but if i try yo upload a big file (more than
17MB) it returns a
java.lang.outOfMemoryError</SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004></SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004></SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>2004-04-16 18:49:56
StandardWrapperValve[OpenCmsServlet]: Servlet.service() for servlet
OpenCmsServlet threw exception<BR>javax.servlet.ServletException: Servlet
execution threw an exception<BR> at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)<BR> at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)<BR> at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)<BR> at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)<BR> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)<BR> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)<BR> at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<BR> at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)<BR> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)<BR> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)<BR> at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)<BR> at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)<BR> at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)<BR> at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)<BR> at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)<BR> at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)<BR> at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)<BR> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)<BR> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)<BR> at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)<BR> at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)<BR> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)<BR> at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)<BR> at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)<BR> at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)<BR> at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)<BR> at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)<BR> at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)<BR> at
java.lang.Thread.run(Thread.java:534)<BR>----- Root Cause
-----<BR>java.lang.OutOfMemoryError<BR></SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004></SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT> </DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT size=+0><FONT
face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=519282008-19042004>Thank
You</DIV></BLOCKQUOTE></SPAN></FONT></FONT></FONT></FONT></FONT></FONT></FONT></BODY></HTML>