wood burning stoves 2.0*
The moose likes JSP and the fly likes check if file exists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "check if file exists" Watch "check if file exists" New topic
Author

check if file exists

Priya Singh
Ranch Hand

Joined: Mar 19, 2004
Posts: 33
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

Joined: Feb 09, 2005
Posts: 11
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

Joined: Feb 14, 2005
Posts: 5
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
 
GeeCON Prague 2014
 
subject: check if file exists