Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 27th, 2005, 11:36 AM
Registered User
 
Join Date: Nov 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is there a Dir() Function with JavaScript

I need to return all of the file names from a particular folder on the local ISS Server Hard drive using Java Script.
Example:
folder Location is C:\FTP_Downloads\MIN\
There are 50 pdfs in this folder
I need the name of each of the 50 pdfs in the folder

 
Old September 28th, 2005, 10:11 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

JavaScript has no functions that interact with the "outside world", it can only do these things via COM or other external objects such as a browser.

If you want to read files using server-side script then you can use the FileSystemObject on an IIS server.

If you want to read files on a server using client-side script then it's unlikely to work. You'd need to have a very low security setting on the browser and the files would need to be on a share. Another possibility is to allow WebDAV requests on the server combined with the XmlHttpRequest.

http://msdn.microsoft.com/library/de...econWebDAV.asp

http://msdn.microsoft.com/library/de...landwebdav.asp


--

Joe (Microsoft MVP - XML)
 
Old October 3rd, 2005, 11:54 AM
Registered User
 
Join Date: Nov 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Looks like that is the answer. Thank you for your help. I will let the group know if it works for me.






Similar Threads
Thread Thread Starter Forum Replies Last Post
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 03:30 PM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
get value from javascript function suzila ASP.NET 1.0 and 1.1 Basics 6 December 3rd, 2005 10:38 AM
Triggering a javascript function badgolfer ASP.NET 1.0 and 1.1 Basics 1 June 30th, 2004 06:31 AM
Dir function and looping through all files naeem VB How-To 2 May 13th, 2004 12:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.