You're lucky, I've already faced this issue and had all the headache that comes with it ;)  The flash player send sometine an empty request to server. The workaround is :
 
if(request.getContentLength() == 0) return null;
 
I found this behavior REALLY weird. But some time after that I've found explanation in the livedocs :
 
>If the file to be uploaded is bigger than approximately 10KB, the Windows Flash Players will first send a test upload POST with zero content prior to uploading the actual file in order to verify that the transmission is likely to be successful. The second POST will contain actual file content. For smaller files, the Flash Player will do a single upload POST with the file to be uploaded.
 
Cheers,
Nicolas
 
----- Original Message -----
Sent: Wednesday, February 08, 2006 10:43 AM
Subject: Re: [osflash] Off-topic: uploading files using FileReference toserver with Java back-end

I remember reading somewhere that ruby was having difficulty reading flash uploads because the flash upload didn't adhere to the spec and ruby does.  I wonder if the commons file upload could be having the same issue?  That is probably where I would start looking.

Dan

On 2/8/06, Igor V. Sadovskiy <[EMAIL PROTECTED]> wrote:

Hello All.

 

Excuse me for off-topic.

 

I'm trying to upload file to server using flash.net.FileReference. I have Java back-end used commons-fileupload-1.1 library (http://jakarta.apache.org/commons/fileupload/ ).

 

But I'm getting an exception:

 

2006-02-07 13:50:48,316 ERROR CommonsMultipartRequestHandler.handleRequest:241 - Failed to parse multipart request

org.apache.commons.fileupload.FileUploadException : Processing of multipart/form-data request failed. Stream ended unexpectedly

      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384 )

      at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268 )

      at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java :233)

      at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209 )

      at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821 )

      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254 )

      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482 )

      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525 )

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760 )

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853 )

 

 

….

javax.servlet.ServletException : Processing of multipart/form-data request failed. Stream ended unexpectedly

at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java :242)

at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209 )

at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821 )

 

It seems library I use doesn't support format used by Flash to transfer files.

 

Has anybody ever faced this issue? Or has somebody had successful experience of using FileReference with Java back-end?

 

Regards,

Igor


_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org




_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to