dcsimg
How to check the existence of a file using javascript
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   neeraja_cp
Posted On:   Friday, September 23, 2011 05:07 AM

I need to check whether a particular fie exists or not using javascript code. I know it is possible using any server side scripting language, but I need to accomplish this task using javascript or ajax.

Is it possible?

Any help would be greatly appreciated..

Re: How to check the existence of a file using javascript

Posted By:   vijay_satlawar  
Posted On:   Thursday, November 24, 2011 02:07 AM

Javascript can not access file system so you can not find out using javascript.

How ever you can use Ajax calls to find out the file on the server and return the information to client

Re: How to check the existence of a file using javascript

Posted By:   Stephen_McConnell  
Posted On:   Thursday, September 29, 2011 02:53 PM

Where does the file reside. One the client or the server?


Javascript usually doesn't have access to the server side and only a small sandbox on the client side. This is for security reasons.


However, if it is on the Server, you could create a web service on your server that goes out and finds a file and passes information back to the client.


What is your web server, what is the server language and do you know how to write a web service? One needs more information before one can answer your question.


Stephen McConnell

About | Sitemap | Contact