How to load image from computer memory? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to load image from computer memory?

<img src="file://E:/Folder/Photo%20folder/image.jpg" alt="Image"> But still it doesn't showing Image on webpage. I am opening file on chorme browser. Is there any solution?

11th Feb 2020, 3:06 AM
RH Tasin
RH Tasin - avatar
11 Answers
+ 6
Tasin R Hasan Get into habit for creating distinct folders for your projects. In the project main folder you can have subfolders where you can put images, scripts, stylesheets etc. separately. It's easier to manage assets this way. I believe VS should be more than capable for project resource management. Having your folders nicely arranged, you can use relative paths in codes (when referring to a resource), this is better than using absolute paths. You'll begin to appreciate goodness of relative paths once you upload your files to the web hosting machine. See this for better understanding about absolute and relative paths 👍 https://www.w3schools.com/Html/html_filepaths.asp
11th Feb 2020, 4:05 AM
Ipang
+ 5
//In sololearn you can't from your local device Here are tips how you can ,let me know it is on sololearn or other ide https://www.sololearn.com/discuss/1054246/?ref=app https://www.sololearn.com/discuss/335228/?ref=app
11th Feb 2020, 3:15 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 3
//Tasin R Hasan can you see browser console , maybe there will be error 404 not found image and try including your html file and image in same folder and adding image like src="./image.jpg""
11th Feb 2020, 4:09 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 3
Tasin R Hasan Using relative path you can try ... <img src="./Photo_folder/photo.jpg" ... Assuming the image filename was "photo.jpg"
11th Feb 2020, 9:48 AM
Ipang
+ 3
Tasin R Hasan Don't forget to read about absolute & relative paths in the link with my previous reply 👍 And you're welcome bro! 👌
11th Feb 2020, 10:02 AM
Ipang
+ 2
Are you using Chrome on the same computer wherey your image is? Is your path correct?
11th Feb 2020, 3:15 AM
Sonic
Sonic - avatar
+ 2
Sudarshan Rai 👑 I think he's using Chrome and not SL code playground.
11th Feb 2020, 3:16 AM
Sonic
Sonic - avatar
+ 2
Is your web page local to the computer where the image is stored?
11th Feb 2020, 3:17 AM
Sonic
Sonic - avatar
+ 2
Sonic Sudarshan Rai 👑 I am using Visual Stdio on my pc. and yes photos are in the same computer.
11th Feb 2020, 3:18 AM
RH Tasin
RH Tasin - avatar
+ 2
Sonic Sudarshan Rai 👑 Ipang My html files are in "Html Folder" and there is a sub folder, name is "Photo_folder". Inside that folder my photos are. Now tell me what should I do to load image from pc.
11th Feb 2020, 9:29 AM
RH Tasin
RH Tasin - avatar
+ 2
Ipang Thanks brothe. It has worked :)
11th Feb 2020, 9:55 AM
RH Tasin
RH Tasin - avatar