Invalid file upload
Martin Olsson <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I have a form on my webpage where the user can upload a file. Sometimes user write the filename (+ path) manually. Of course these filenames (+paths) are sometimes invalid so in the .php script I check if the uploaded file was valid or not. If it wasn't valid I print "Bad file upload". I have written tests for all the forms on my webpages. For instance it tries to login with a username and makes sure that a "you must specify username" text appears and so on. Now, I would like to implement a similar test for the file upload box. I want to have httpunit manually write something like "hello" (or any non-existent filename) and submit the form in order to assert that the "Bad file upload" message really appears properly. The problem is that the httpunit form setparameter function only accepts File() objects that refer to an existing file. How can I have HTTPUNIT submit a form with a faulty file upload? regards, martin ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642