• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Have a question about registration form

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Upload what file? You can also do Client-side validation using javaScript.
 
chang Anne
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
In my registration form, there are two textfield,
id(require a unique one <input name="id" type="id">)
user's pic(<input name="userpic" type="file")
I use javascript to validate id and pic for user enter nothing.
I encountered a problem that I have a restriction on id, using
server-side validation but user's pic have already uploaded.
The user press "previous page" on browser, user's uploaded file stay in directory.
Any ideas?
Thanks.
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"?
 
chang Anne
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic