The application I'm developing has a requirement for the user to click on a button and a file is uploaded to a remote server. Furthermore, the user is not to be aware of the location of the file on the client machine. And on top of that the file to be uploaded can be one of several files uploaded, depending on what the user is doing at the time.
From the JSP page, I submit with an action that calls a function that has the following in it:
Originally posted by James Templer: The application I'm developing has a requirement for the user to click on a button and a file is uploaded to a remote server. Furthermore, the user is not to be aware of the location of the file on the client machine. And on top of that the file to be uploaded can be one of several files uploaded, depending on what the user is doing at the time.
Sounds fishy. How are you getting the location of a file to be uploaded without the user specifying which file to upload? Your problem will stem from the fact that the input type=file tag will throw some handy dandy stuff in the header so that HTTP knows what to do. Doing that from JSF will be difficult if not impossible to a point.
Is there a reason why you can just step completely out of JSF for this task? Or could you clarify your requirements a bit more and maybe we can find a different/better solution?
Joined: Jul 03, 2006
Thank you for your help.
The application is for a disabled student resource center (dSRC) at a community college. This is totally being done on a volunteer basis. Anyway, they have form letters that go out by the thousands and I'm trying to automate the process. I know that they'll need to change the form e-mail template from time to time. The law and school policy change what has to be on these forms every few years. The idea is that they click on a button to edit the form template and have three options at this point: save the template to be used in the email mail merge, send a one-up dummy test email, and validate the template's HTML. There are enough people around that know the basics of HTML but knowing that you even can validate it is beyond them. A new law in our state requires that all electronic media be accessible and the first step to being accessible for a web page is to validate properly. They could be editing one of several templates and that is the one they will be validating when they click on the validate button. The code nicely redirects to the W3C validator site file upload page but of course with no post data.
And no, this doesn't necessarily have to happen within JSF. But the backend Java code is the one that reads the appropriate file the client will be editing.