mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Unable to Show local image file:///tmp/someimage.jpg #530
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ctrl-alt-d on GitHub (Jul 15, 2020).
First, sorry about to post a question.
The issue is that I'm not able to show local images via
<img src="file:///path/to/someimage.jpg ....I posted the question on Stack Overflow 9 days ago:
Is someone so kind to give me instructions about how can I show on electron window picture files from local storage.
Thanks!!
@IRHM commented on GitHub (Sep 8, 2020):
I'm having the same problem. I was able to use your workaround (converting image to base64), but a big problem for me is when trying to load a video file.
If the video file is big (~500mb) then converting to a base64 string will just take too long.
When loading a video/image (like:
src="file:///path/to/video.mp4") the chrome console shows this error:For blazor atleast, putting the video inside the
wwwrootfolder will allow it to load normally, but that isn't a real possibility for me.@IRHM commented on GitHub (Oct 5, 2020):
Anything happening with this?
@IRHM commented on GitHub (Oct 30, 2020):
@ctrl-alt-d @GregorBiswanger I think this is a bug
@FlorianRappl commented on GitHub (Nov 7, 2025):
This is not a bug @IRHM - it's how Electron works (see, e.g., https://stackoverflow.com/questions/50272451/electron-js-images-from-local-file-system).
You will need to serve this file - i.e., just create an endpoint somewhere and this endpoint does the file system access. This way, your HTML code uses http -> communication with your ASP.NET server and then from this you load / transport the contents of the file from the local FS.