+ 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?
11 Respostas
+ 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
+ 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
+ 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""
+ 3
Tasin R Hasan
Using relative path you can try ...
<img src="./Photo_folder/photo.jpg" ...
Assuming the image filename was "photo.jpg"
+ 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! đ
+ 2
Are you using Chrome on the same computer wherey your image is? Is your path correct?
+ 2
Sudarshan Rai đ I think he's using Chrome and not SL code playground.
+ 2
Is your web page local to the computer where the image is stored?
+ 2
Sonic Sudarshan Rai đ I am using Visual Stdio on my pc. and yes photos are in the same computer.
+ 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.
+ 2
Ipang Thanks brothe. It has worked :)