Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

check if file exists

 
Priya Singh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have to decide for a optimal solution.

I have a form, on Submit , it disables the submit button and submit the form again which in turn executes Java code to check if the file exists on server or not.

My problem is, that I want to give a message after teh check is done to the user that the file is found or not found and then do the processing (ve to create file if it doesnt exist) .

I tried it with Java script but it doesnt seem to be a good option.

any suggestions !
 
Rigel Kentaurus
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Priya Singh:
Hi,
I have to decide for a optimal solution.

I have a form, on Submit , it disables the submit button and submit the form again which in turn executes Java code to check if the file exists on server or not.

My problem is, that I want to give a message after teh check is done to the user that the file is found or not found and then do the processing (ve to create file if it doesnt exist) .

I tried it with Java script but it doesnt seem to be a good option.

any suggestions !


Are you sending the complete file to the server? (ie, uploading it?) if this is the case keep in mind that you don't get to the servlet service() until all the file contents are sent by the browser.
 
Shan Tiruvarur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the form tag you can add a method
onSubmit()

you can write your code here to display a dialogue or whatever.


vidhyasankar.natarajan@wipro.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic