Alternatively, you could use AJAX from the client-side to invoke the check on the server as the file upload progresses. The server side could then get the file size (providing the browser correctly sends the request size) and you could parse the file as it is read in by the servlet. Then just keep reporting back to the client via the AJAX result for success or failure. At any time, you can kill the upload connection to stop the browser from submitting any further data (ie: if it is a very large file and you notice in the first few bytes that the header is wrong, you can stop the connection right away rather than having the user wait until the upload actually finishes).
Nick -----Original Message----- From: Jonathan Harley [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 05, 2006 6:05 AM To: MyFaces Discussion Subject: Re: supplement fileupload with client side validation for size and file type Guy Katz wrote: > Can anyone recommend a good way to add client side validation for file > uploads (specifically size and maybe type validation)? There isn't an easy way to do this, because JavaScript doesn't have access to files on the client (for obvious security reasons). I guess you'd have to write a Java applet - trusted (signed) applets can do it. jon -- ..................................................................... Dr Jonathan Harley . . Email: [EMAIL PROTECTED] Zac Parkplatz Ltd . Office Telephone: 024 7633 1375 www.parkplatz.net . Mobile: 079 4116 0423

