> > This is interesting, is there a way to know before the file is sent the > size > of coming upload? >
>From the client side you do not have access to the file that is going to be uploaded, all you can do is inspect the POST on the server side. I believe that most modern browsers will send the content-length along with the file so that it can be rejected before much data has been read off the wire. Tapestry is using http://commons.apache.org/fileupload, you can read up on what's possible with this library. Josh On Wed, Jul 16, 2008 at 5:25 PM, Angelo Chen <[EMAIL PROTECTED]> wrote: > > Hi Josh, > > This is interesting, is there a way to know before the file is sent the > size > of coming upload? this will be very handy to warn the user for a long file > uploading operation or just simply rejects the upload as the file size is > beyond the allowable size. > > Angelo > > > joshcanfield wrote: > > > > By the time you are checking the file size the whole stream has already > > been > > read in by the MultipartServletRequestFilter. The default is to have > > unlimited upload size. You can add configuration to change the limit. > > I believe this will work, but I have not tested it. > > > > public static void > > contributeApplicationDefaults(MappedConfiguration<String, > > String> configuration) > > { > > configuration.add(UploadSymbols.FILESIZE_MAX, 10000); > > } > > If you want to have a different max upload size per form, then I'd guess > > you'd want to replace/supplement the MultiServletRequestFilter. > > > > Josh > > > > > > On Wed, Jul 16, 2008 at 3:58 AM, Martin Kersten > > <[EMAIL PROTECTED]> > > wrote: > > > >> Hi User-Group, > >> > >> I expirence the following Problem: > >> > >> Using Tapestry + GWT I send a UploadRequest to a Tapestry Page. > >> Once the Upload is processed the HTTP-Page containing 'OK' is > >> returned, otherwise the Name of the Exception/Reason. > >> > >> On the server side the T5-page checks the size of the > >> request-payload and response with a OversizedException. This > >> exception is send to the client. This works very well with a > >> single problem: > >> > >> Sending 300MB of Data the browser blocks until all 300MB are > >> Transmitted but the page/server immediatly (used sysout to ensure) > >> Rejects the transmittion by writing the OversizedException to > >> response (MarkupWriter). > >> > >> I tried several things to stop the request upload from browser. > >> I tried to open the content-input-stream of the request and > >> Immediatly close this stream. With virtually no effect. > >> > >> Is there anyway to stop/break/destroy an request-upload of that > >> size? > >> > >> Since all three major browsers (Opera, FireFox, IE) behave in the > >> same way I guess the problem lies on Server-Side. So who is to blame > >> for? Tapestry? (Dont think so), Tomcat?, Browsers? > >> > >> (In Short: You want to upload 300MB? I just read 10K and Say No To you!) > >> > >> > >> Cheers, > >> > >> Martin (Kersten) > >> > >> PS: This is the Ajax way of doing things. The form (upload) is send to > >> the server and the target of the response is an 'hidden' Iframe. > >> > >> PSS: If it is the browser I just would use the Upload Progress Listener- > >> Mechanis I use to get the progress of the current upload. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > -- > > -- > > TheDailyTube.com. Sign up and get the best new videos on the internet > > delivered fresh to your inbox. > > > > > > -- > View this message in context: > http://www.nabble.com/tapestry-hibernate-problem-tp18483952p18499364.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] > > -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox.