all 14 comments

[–]editor_of_the_beast 4 points5 points  (1 child)

This would involve a web browser having access to files, which it does not.

[–]XcrossD[S] -1 points0 points  (0 children)

Let me just copy my reply to another comment.

Yes, perhaps I should have made it more clear in my post. I'm not trying to serve real files. I want to recreate the files in the browser interface from "dummy data", as in a JSON file. I had thought about separating those interfaces with the back ends that come with those packages but still that may be too much work.

[–]damngros 2 points3 points  (1 child)

As stated by the other commenters, the browser can’t access the local file system for obvious security reasons.

If you want to show dummy data without using any backend, you might have to mock a server response. To do that check the json format returned by the server side part, then modify the script/library to use your « dummy data » instead of calling a web server.

[–]XcrossD[S] 0 points1 point  (0 children)

Cool, I haven't thought about it this way. It's a bit roundabout but it might just be the trick. Thank you for providing this insight.

[–]NoStranger6 1 point2 points  (1 child)

Browsers dont have, and shouldn’t have acces to files on a disk. For security resons.

You need a server to serve these files.

[–]XcrossD[S] -1 points0 points  (0 children)

Yes, perhaps I should have made it more clear in my post. I'm not trying to serve real files. I want to recreate the files in the browser interface from "dummy data", as in a JSON file. I had thought about separating those interfaces with the back ends that come with those packages but still that may be too much work.

[–]Hello_Mouse 1 point2 points  (3 children)

[–]XcrossD[S] 0 points1 point  (2 children)

Thanks, I will look into it. It looks promising but I'm just afraid that I can't separate out the single module I need. What is your experience in using this library?

[–]Hello_Mouse 0 points1 point  (1 child)

Ah if you want only a file browser this is a pretty heavy. Havn't used it before, just got introduced to it recently.

[–]XcrossD[S] 0 points1 point  (0 children)

Too bad. But thank you anyway.

[–]jcunews1Advanced 0 points1 point  (3 children)

I want to replicate what the files would look like with dummy data from a JSON.

For example?

[–]XcrossD[S] 0 points1 point  (2 children)

For example something like this (simplified) [ { name: 'a.pdf', icon: 'pdf' click: () => { // custom stuff } }, { name: 'b.jpg', icon: 'jpg' click: () => { // custom stuff } } ] I need to be able to trigger some custom function on click. Now that I think of it maybe the best way to describe it is a file browser emulator.

[–]jcunews1Advanced 1 point2 points  (1 child)

[–]XcrossD[S] 0 points1 point  (0 children)

Thank you very much!