K
K
Kotaro Hiba2020-08-05 16:49:03
JavaScript
Kotaro Hiba, 2020-08-05 16:49:03

Is it possible to get a list of files?

There is a simple html page with a JS script, there is a media folder with music, how can I get the names of all files in this folder?
5f2ab7dace5e4438167630.png
I'm trying to make a simple player on Vue, but I can't figure out how to scan a folder, so that I can then output all the audio on the page for inclusion.
I thought to do it through fs, but this stray seems to be only for server-side JS (or I did something wrong), please help.
5f2ab8c60d220884390906.png
5f2ab92146a9f065255056.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Karpion, 2020-08-05
@lina666

And where exactly "there is a media folder with music" - on the machine where the browser is running; or on the server where the script is loaded from?

A
Artyom, 2020-08-05
@airman66

I could be wrong, but this can only be done through the backend

M
McBernar, 2020-08-05
@McBernar

No you can not. js does not have access to the file system in the browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question