i have been trying to get myself unsubscribed from stupid struts. 5 emails i sent already to the user-unsubscribe... but i still get 100 emails about how to make a link and how to make a stupid form...get me off this meta deta hell!!!!
-----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Saturday, July 30, 2005 3:48 PM To: user@struts.apache.org Subject: Re: FormFile.getFileData() not throwing FileNotFoundException? nicole.wollgast wrote: > I am using Struts 1.1. I have found the following problem when using > FormFile. If the user enters a nonexistent path into a <html:file> > (not using the FileSelector, but inserting the file directly into the > input field), struts doesn't recognize, that the file doesn't exist. > Even a call to FormFile.getFileData() doesn't throw a > FileNotFoundException, it just returns an empty byte[]. > > Is this a known bug in Struts? Or what else can go wrong here? It's been some time since I looked at the code underlying this behaviour, but as I recall there is no way to distinguish between the user submitting a non-existent file and a zero-length file. You need to handle both the same way and either tell the user 'the file you selected is empty or does not exist' or, depending on what makes sense for your application, just accept the zero-length file irrespective of whether it existed client side or not. Unfortunately you can't solve this client side either (at least not trivially). L. -- Laurie, Open Source advocate, Java geek and novice blogger: http://www.holoweb.net/laurie --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]