I'm developing A online file manager. Like Xdrive.com.
I'm using JSP with JAva beans . i'v a form in which
i'v placed a HTML file Input tag. i'm posting this
page to a JSP page whch is using a bean and i'm
apssing a pagecontext object to the bean. In bean i'm
trying to get the data of the selected file from the
client by getting the request inputstream and then
reading binary data but it doesn't behave like i'm
expecting it. Here is the code.
m_totalBytes = m_request.getContentLength();
m_binArray = new byte[m_totalBytes];
while (totalRead < m_totalBytes)
{
try
{
m_request.getInputStream();
readBytes =
m_request.getInputStream().readLine(m_binArray,
totalRead, m_totalBytes - totalRead);
totalRead += readBytes;
}
catch (Exception e)
{
System.out.print (e);
}
}
in this m_binArray is a byte array which is supposed
to receieve the data in the file. but it never do like
this.
Plz help me out.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets