C
C#11mo ago
Tobonautilus

Is there any possibility to iterate over all files in wwwroot/myfolder using Blazor WASM?

I know that you can just request a file using a simple web request. For my usage I need "gimme all the (markdown) files that are in this folder in wwwroot. So far, I think my approach aint working out because WASM does not like file access and I could not find any way to have a wildcard web requests which would make just sense for me - and only for me. Thanks for your help!
5 Replies
Angius
Angius11mo ago
There's not Blazor WASM works entirely in the browser It has no insight into the server's file structure, it only knows what's served Wildcard requests are also not a thing Your best bet is probably to generate a manifest of those files on build, load that manifest, and grab all the files mentioned in it
blinkbat
blinkbat11mo ago
+1 for adding it to your client build process if the client needs it
Joschi
Joschi11mo ago
Isn't he talking about the wwwroot of a standalone WASM app? If so there is no server involved, but I'm still unaware of a way to enumerate those files.
Angius
Angius11mo ago
Correct, there's no server involved, so you can't enumerate those files easily Generating a manifest on build is your best shot, that's why I suggested it
Tobonautilus
TobonautilusOP11mo ago
Thanks you all. I think my new approach will be, have a Action running before deplyoing the app that smashes all mardown files into a json file and than fetch just the json file via http which is no problem.
Want results from more Discord servers?
Add your server