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
-- 
View this message in context: 
http://www.nabble.com/T5-with-swfuploader-stream-failure-tp20415947p20415947.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to