I'm hosting a static website on Amazon S3. In my Bucket there are also some .txt , .pdf, .svg files stored. I want to display a list of these files (only names no content) on my html website with javascript. As users can upload files to the bucket the names always change. That's why I want to list them. And I do not want to list all files instead of showing the html file but show html file with a table that lists files from a specific folder in the bucket.
I do not use nodejs just js for browsers. I try not to use any new modules. The Project should remain simple.
I already read tutorials on using nodejs modules like 'fs' in the browser with help of browserify. I didn't manage that or any other ideas I've found.
I read something about FileSystemDirectoryReader for js but that's not generally supported yet. Would WebKitFileSystem meet my needs? I understood that most of the fileSystem APIs work with virtuall directories not the directory i need.
Now I wonder if I actually need anything like npm modules as I do not want to access the Client FileSystem but my own fileSystem on S3. I already read data from those files with XMLHttpRequest but can I also just list the names?
It'd be great if I had some code like: var arrFiles = []; arrFiles = readFiles("./files/*");
Another Approach would be using AWS Lambda to read all file names, save those as a list in a text file and read that file with js to print the names on the website. Seems to be complicated.
If that makes any sense. Thanks in advance