Hello All,
using javascript i want to list file name from folder
suppose my folderpath ="C:\Users\user\Desktop " suppose on Desktop 10 document file then
how to show the file name in alert box
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Akhil MittalRank #133 · 16.9K reputationPosted Jun 11, 2014, 3:43 AM EDT
var _getAllFilesFromFolder = function(dir) { var filesystem = require("fs"); var results = []; filesystem.readdirSync(dir).forEach(function(file) { file = dir+'/'+file; var stat = filesystem.statSync(file); if (stat && stat.isDirectory()) { results = results.concat(_getAllFilesFromFolder(file)) } else results.push(file); }); return results; };usage is clear:
_getAllFilesFromFolder(__dirname + "folder");Ravi PatelRank #439 · 5.7K reputationPosted Jun 11, 2014, 10:29 PM EDT
JScript allow do to this you can list the server or client files in your web page using ActiveX objects (work in only IE browser) but i want to make it work in all browser can you help me how to do that here is my code
Path :