Please use them to format any code that you post. Old old thread Facebook Like. Twitter Tweet. Be a part of the DaniWeb community. Sign Up — It's Free! Reply to this Topic. This question has already been solved! The person who asked this question has marked it as solved. Solved questions live forever in our knowledge base where they go on to help others facing the same issues for years to come. Are you sure you have something valuable to add that has not already been mentioned?
Consider starting a new topic instead. Otherwise, please be thoughtful, detailed and courteous, and adhere to our posting rules. Edit Preview. H1 H2. Well, yes, but node. Did you try my suggestion? Thank you very much. I tried this but now I detect error which cause it doesn't work.
When I use echo in give text "Array", I guess it's fine. Now I just need to loop throught this array to get file names - am I right? This doesn't work. Don't use the domain, but the path to the images directory. Even if I use relative path and change print to echo it won't work. Show 6 more comments. I created a website project with VS and try your solution but unfortunately, nothing appears.
Amir Make sure you have directory listing enabled on the directory. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.
Email Required, but never shown. The Overflow Blog. Podcast Helping communities build their own LTE networks. Run JavaScript Editor 2. Loop through all files in a given directory with node.
Step 1 : Specify the folder. Follow these steps. You are misunderstanding what dir. Get the path of the directory using path. If I add new files on that directory, the file names should be displayed on the html pages without editing it.
We do this by using the. GetFolder objStartFolder Wscript. The second parameter is the array of extensions that should match the listing. This will only work on Chrome, Edge, and Opera at the time of writing.
Here below is how to achieve it: 1. There is a big difference between the two. If null is given, all files are returned. So every time we run fs. One other solution is get it using the System. They behave in the same way. Create a simple html page with source code below and open it via Chrome.
You can verify what directory ". Using the built-in method process. Echo objFile.
0コメント