Newbie: Checking for and creating directories

G

Gnarly

I have a web application front end to a database that stores files &
metadata and I need to force the File checkout to a specific drive and
directory.

The problem I have is that the directory may not always exist, so I need
some code to check the existance and if it's not there create it.

All hosts using this will be Windows NT/2000 running ie 5.5 and above.

Can this be done, if so how?


Many thanks in advance.
 
L

Laurent Bugnion, GalaSoft

Hi,
I have a web application front end to a database that stores files &
metadata and I need to force the File checkout to a specific drive and
directory.

The problem I have is that the directory may not always exist, so I need
some code to check the existance and if it's not there create it.

All hosts using this will be Windows NT/2000 running ie 5.5 and above.

Can this be done, if so how?


Many thanks in advance.

Client-side JavaScript, in normal security environment, cannot access
the file system.

Besides, even in relaxed security environments, there are not
cross-browser solutions. You mention IE, so you might want to take a
look at the FileSystemObject, which can be scripted by client-side
JavaScript. This allows you all directory and file operations, but only
under relaxed security conditions.

Check Google for numerous examples of the FileSystemObject. All VBScript
examples can easily be adapted for JavaScript.

See also MSDN:
<URL:
http://msdn.microsoft.com/library/d...en-us/vbenlr98/html/vaobjfilesystemobject.asp>

Hope that helps.

Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top