Hello, I have a form with input text fields and a file field for user registering. And I have a validation of user personal information like id on server-side. My question is if the user provide the wrong infromation but he/she already upload the file. Then He quit the register but the server side have the file. How should I do to avoid the above problem? Any suggestions? Thanks.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Joined: Jul 02, 2003
chang - I find it difficult to understand your problem. I encountered a problem that I have a restriction on id, using server-side validation but user's pic have already uploaded. Why don't you validate your id before uploading the "pic"?
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Joined: Jul 02, 2003
Hello, Sorry, I didn't say clearly. I have two pages. First page is used for user input(user enter unique id, upload file). Second page is used to display the error messages(like, Your id is not available..) and let users reenter their id. In my original thought, user enter a id and upload the file, And, I check the id is unique or not and copy the file in folders. If id is not unique, turn to second page, user just need to reenter the id. There's a problem in my process of user registration. As users don't finish their registration but already upload the file(in program I copy the files they provide). As Andres Gonzalez suggests, Before uploading the pic I valide the id is valid or not. My question is How should i remain the file the user provide in second page? Any suggestions?
My question is How should i remain the file the user provide in second page?
If I understand what you are asking, and I'm not sure that I do, I don't think you can. The file is being uploaded as part of a multi-part request on the first submission. Deferring the processing of that file to a second request after a verification page is not possible since the uploaded file cannot be carried over to the subsequent request. Is it not possible to change the manner in which you are conducting registration? It seems odd to me to upload a file prior to successfully registering. I'd suggest making the file upload a second operation that the user completes after the user id has been successfully validated. hth, bear