List documents with type icon

Hi folks!

Anybody know how to dynamically list documents (PDF, DOC etc) from a folder on the site together with their type icon? Like a document library list
Thanks in advance
//A

I found the following, via Google, for finding all the files in a folder on the server (replace “” in the 2nd line with your folder name):

var fs = require(‘fs’);
var files = fs.readdirSync(‘//’);

WRT icons, I have found Font Awesome to be great (er, awesome ); for your specific needs, check out Find Icons with the Perfect Look & Feel | Font Awesome.

Hey Abergquist

Thanks for the code-piece. Awsome! I however eneded up with tossing in Google drive as an embedded page (Iframe). It gives me a easy way to quickly display my product documents and pictures on the site. Its too much of a hussle with the Wix-interface in regards to upload (documents/photos)

Cheers
Andrej

Creative solution!

Thanks again Abergquist! As you know its pressed for time to express all needs of the situation but I can recommend this one for peers in similar needs. Its easy and efficent!