Home>

Trying from the VUE component to call the READDIR function to get a list of files by some directory

FS.Readdir (Path, (Err, Data)= >
 {
  Console.log (DATA);
})

However, an error occurs: uncaught Typeerror: FS.Readdir is not a Function

tried to make a function in a separate file, but the error remains

Nodejs FS.Readdir will work only on backend or in a specific environment of type Electron

nörbörnën2021-09-17 18:36:47

@ Nörbörnën, is there any other way to get a list of files that will suit here?

hyperspace422021-09-17 18:47:10

A server script is written to obtain a list of files (not necessarily on a node, can you even at the PCP at least Bashe) ???? This server script connects to the HTTP server ???? From the client part there is a Ajax request, when receiving which the server executes the script and responds to the client part of the result (list of files). //The main thing is to remember about Chroot and other good things that protect against foreign curious requests, and not eval tracks received from the user ...

yar852021-09-17 18:56:31

If we are talking about a list of files on the client machine, it seems that there is no cross-browser solution. wicg.github.io/file-System-Access will only work in chrome. In general, the list of files can be obtained from Input File Multiple

nörbörnën2021-09-17 19:04:29