Author Login
Post Reply
Hi all,
I'm trying to use SWFUploader into my Tapestry application. My app will have
a functionality which upload files > 100. AFAIK Tapestry-Uploader does not
support multiple uploading. I have problem when receiving stream/uploaded
files from SWF Uploader(or any other flash uploader) into Tapestry page/jsp,
everytime I read the stream it always return -1 even though it has content
length > 0. By the way, Tapestry-Uploader works perfect.
HttpServletRequest request =
requestGlobals.getHTTPServletRequest();
String contentType = request.getContentType();
System.out.println("Upload result:<br>");
//System.out.println(getServletContext().getRealPath(request.getRequestURI()));
if ((contentType != null) &&
(contentType.indexOf("multipart/form-data") >= 0)) {
DataInputStream in = new
DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < formDataLength && totalBytesRead >=
0) {
byteRead = in.read(dataBytes, totalBytesRead,
formDataLength); // byteRead always zero
totalBytesRead += byteRead;
}
}
Regards,
Ronny
--
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)