Like the title already shows, i want to preview an IMAGE on my page ---> BEFORE-UPLOAD <-- on my page.
I know how to achieve this --> by using the HTML-Component, but i can't find a way of how to use for example Node-FS (File-System) to get it to work.
What do i need to know about FS ???
1) Works only on Backend (checked) !!!
2) Don't have to install any NPM, because already included (checked),
3) Am i able to open directly a FILE (for example an ordinary TXT-File) on my computer, without first have to upload the TXT-File???
4) If there is no ability to open a Blob-Window directly, how to proceed else (workaround) ?
5) What would be the right PSEUDO-CODE-CONSTRUCT to use FS ???
6) How would look like a working ---> PATH ?
a) --> c:/xxxx/yyyyy/zzzzz/text.txt <--- ? (opening from local machine possible)
b) --> https://www.zzzzzzz.com/..../text.txt ???
7) What else do i need to know, to be able to use FS the right way?
Example???
import fs from'fs';
let PATH = "??????????????";
let dataBuffer = fsExtra.readFileSync(PATH);
Ok, to be more precise....
I need the base64-code of an IMAGE before it gets uploaded.
How do i achieve my aim (by not using either an html-component, nor a custom-element) ?
1) I am able to achieve my wished functionality --> by using a html-component.
2) I am able to achieve the same functionality --> by using a custom-element.
3) But how to generate such a function --> but not using the both at all?
I want to extract the base-64-code of an image before it gets uploaded.
That means directly after selecting an image inside a BLOB (File-System).
Do i mix something up ???