struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tuğrul Ünsal <>
Subject binary data from form
Date Tue, 25 May 2004 08:11:26 GMT
Hi, I am migrating an old project to struts. In the old project I had a
jsp which has a form with definition like 
  <form action="somejsp.jsp" method="post" ENCTYPE=multipart/form-data>
and some text and file type inputs in it. In somejsp.jsp I take the
request object and process it in a java class. In the following
statements :
      ServletInputStream in =
      byte[] bytes = new byte[512];
      int i = in.readLine(bytes,0,512);
i returns something about 45 and I process through it and there is no
problem. When I migrate this to struts I made the main jsp, a form bean
for it and an action for it. The form's definition is : 
<html:form action="" enctype="multipart/form-data"
method="post" >
in the form-bean, datatype of the file fields is Object(I am not sure if
making this is true). In the forms action I implemented the same
statements above and I always get -1 for i. So I cannot process the
ServletInputStream. Can anyone help me about this problem.... thanks...

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message