You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use an OpenFileDialog to select a local file and display the chosen image in the frontend using <img src={imageSrc}>. However, since absolute file paths cannot be directly used in the frontend for security reasons, I load the image in the backend, convert it to Base64, and then return it to the frontend.
This method works, but I wonder if there is a more standard or efficient approach to selecting and displaying an image in the frontend. Are there any best practices or alternative methods that are commonly used?
My goal is to scan an entire folder and display all the images on the screen.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to use an
OpenFileDialog
to select a local file and display the chosen image in the frontend using<img src={imageSrc}>
. However, since absolute file paths cannot be directly used in the frontend for security reasons, I load the image in the backend, convert it to Base64, and then return it to the frontend.Here's how I handle it:
This method works, but I wonder if there is a more standard or efficient approach to selecting and displaying an image in the frontend. Are there any best practices or alternative methods that are commonly used?
My goal is to scan an entire folder and display all the images on the screen.
Beta Was this translation helpful? Give feedback.
All reactions