JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
getting file names in a directory using java script lang. Posted by ilker_konar on 13 Aug 2003 at 7:49 AM
Hi;
I am trying to traverse in a directory in a local machine, and get names of all the files there. Could you please help me?
I am waiting to hearing from you.
Report
Re: getting file names in a directory using java script lang. Posted by WaltP on 13 Aug 2003 at 4:55 PM
: Hi;
: I am trying to traverse in a directory in a local machine, and get names of all the files there. Could you please help me?
: I am waiting to hearing from you.
:
JS can't do it. It's been designed to interact as far as the browser only for security reasons. If it could, how would you like someone to write a script that reads your entire drive and sent it back to the owner of the web page?


----------------
Walt


Report
Re: getting file names in a directory using java script lang. Posted by ilker_konar on 13 Aug 2003 at 11:40 PM
Hi WaltP;
In fact, the job that I am trying to do: There a lot of files in a directory in name plus date format like "volumes1302030947". 13 is the day, 02 is the month, 03 is the yaer, 09 is the hour and 47 is the minutes. I have designed a html page. The user enters the date criterias(only day, month and year), and the files appropriate to them will be listed. And the user than, will select one of them. And the file will be opened. Here, I anyway authorize the user, because the machine is mine. And perhaps I may not publish the pages in the internet, and I can use them myself. Can I not access my machine?
I hope I could understand. Do you have any idea?
Report
Re: getting file names in a directory using java script lang. Posted by WaltP on 14 Aug 2003 at 9:10 PM
This message was edited by WaltP at 2003-8-14 21:12:26

: Hi WaltP;
: In fact, the job that I am trying to do: There a lot of files in a directory in name plus date format like "volumes1302030947". 13 is the day, 02 is the month, 03 is the yaer, 09 is the hour and 47 is the minutes. I have designed a html page. The user enters the date criterias(only day, month and year), and the files appropriate to them will be listed. And the user than, will select one of them. And the file will be opened. Here, I anyway authorize the user, because the machine is mine. And perhaps I may not publish the pages in the internet, and I can use them myself. Can I not access my machine?
: I hope I could understand. Do you have any idea?

I feel your pain. As I said, for security, JavaScript cannot read the disk. The only possibility I can think of would be to create a file that you can include in your JS, maybe assigning each filename to an array, but this file will have to be recreated as new files are added.

The other option is to use PHP, ASP, or Perl.


----------------
Walt




Report
Re: getting file names in a directory using java script lang. Posted by ilker_konar on 14 Aug 2003 at 10:38 PM
Thank you, Walt.
I have accomplished it using VBScript. See you...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.