You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Tran <da...@hotmail.com> on 2002/11/13 22:45:58 UTC
Seeking multiple files upload action source
Hi, I would like to write web page to upload multiples file to the server.
I think I known how to set upthe jsp and action form. However, I have a
hard time accepting
the strutsupload action example from 1.1 distribution where it manualy read
binary data from the request
<snippet>
//write the file to the file specified
OutputStream bos = new FileOutputStream(theForm.getFilePath());
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
bos.write(buffer, 0, bytesRead);
}
bos.close();
data = "The file has been written to \"" + theForm.getFilePath() + "\"";
</spippet>
Is there a better automation way?
Sorry if this question is trivial.
-Dan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>