st.chalz Posted January 6, 2015 Share Posted January 6, 2015 I would be gratefull to get a step by step guide to solving this minor problem of which in know is not an issue for most of you guys.am a newbie. actually i am developing locally on my IIS 8. have been able to produce .html files, but when it comes to attaching images to the web pages i always have a small box with a broken link.how do solve this problem or where do i need to go to on my system to locate this problem Link to comment Share on other sites More sharing options...
davej Posted January 6, 2015 Share Posted January 6, 2015 Create a little tiny example file to show us what you are doing. Link to comment Share on other sites More sharing options...
Ingolme Posted January 7, 2015 Share Posted January 7, 2015 That just means that the URL you linked to for the image is incorrect. What does your <img> tag look like? Link to comment Share on other sites More sharing options...
st.chalz Posted January 7, 2015 Author Share Posted January 7, 2015 Summary of the image issue 1; Am actually using the NOTEPAD on my computer to assemble codes for my web development.i have created an index.html file and stored it on my desktop i.e ( in a web folder) accordingly. 2; furthermore, i tried to include images to the webpage(index.html file) so as to make the "index web page" look attractive. now i took the following steps: a)i inserted this <img src="photo0537_001.jpg" alt="jpg file" style="width:304px;height:228px"> into my index.html file which is on my NOTEPAD, but when i try to view it on my web folder; it would show me an image box with no picture in it. now the image am actually trying to place on my webpage is on my desktop i.e (pictures folder). NOTE: the issue, now is i dont know if that could be the correct location to fetch images from in other to place on my webpage. or are there other alternatives. 2ndly, am developing offline i.e using my IIS 8 webserver. I will highly esteem your swift response as to your candid advice to this minor issue. Link to comment Share on other sites More sharing options...
davej Posted January 7, 2015 Share Posted January 7, 2015 Yes, but now photo0537_001.jpg must be in the same folder as index.html <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"/><title>index.html</title><style>body{background-color:#777;}</style></head><body> <img src="photo0537_001.jpg" alt="jpg file" style="width:304px;height:228px"/></body></html> Link to comment Share on other sites More sharing options...
st.chalz Posted January 7, 2015 Author Share Posted January 7, 2015 thanks for your response davej,i did this the same way u prescribed but i still encountered same problem. Link to comment Share on other sites More sharing options...
davej Posted January 7, 2015 Share Posted January 7, 2015 Well, I don't know what you are doing. What is a NOTEPAD? If the index.html file and the jpg file are both on your desktop then you should be able to see the image. Try... <img src="http://www.orseu-concours.com/54-189-thickbox/epso-numerical-reasoning-test-2-en.jpg" alt="jpg file" style="width:304px;height:228px"/> Link to comment Share on other sites More sharing options...
dsonesuk Posted January 8, 2015 Share Posted January 8, 2015 Have you set up you desktop folder as a virtual folder within IIS 8? Otherwise you would have to use file///c:/users/username/desktop/webfolder/index.html.When using notepad you have to make sure you save it as UTF8 Encoded, also make sure you have saved it as .html and not ,html.txt, this can happen if hide known file extensions is used, so even though you see myfile.html it is really myfile.html.txt. Link to comment Share on other sites More sharing options...
st.chalz Posted January 8, 2015 Author Share Posted January 8, 2015 Well, "davej" this is is what my code looks like in my NOTEPAD... <!DOCTYPE html><html><head><meta charset="UTF-8"><title>PHP Demo</title><link href="Site.css" rel="stylesheet"></head><body><div id="main"> <header> <h1><b>Flexmall.com</b></h1> </header><nav id="nav01"></nav><h2></h2><div id="nav"><h2><b>Bulleting</b></h2><hr><p>Pages (HTML)</p><br><p>Style Sheets (CSS)</p><br><p>Computer Code (JavaScript)</p><br><p><a href='about.html'>why you would like to know us</a></p><br><p><a href='Motivationals.html'>Motivationals</a></p></div></br><img src="photo0537_001.jpg" alt="jpg file" style="width:304px;height:228px"/><div id="footer"><footer id="foot01"></footer></div></div><script src="Script.js"></script></body></html> Now all are visible when i view it in the webfolder , but the IMAGE element isnt visible... that is just the problem am experiencing Link to comment Share on other sites More sharing options...
st.chalz Posted January 8, 2015 Author Share Posted January 8, 2015 "DSONESUK" i would be glad if you would direct me on how to go about setting up my desktop folder as a virtual folder on IIS 8. or where to input this, file///c:/users/username/desktop/webfolder/index.html. as u adviced. Link to comment Share on other sites More sharing options...
Ingolme Posted January 8, 2015 Share Posted January 8, 2015 Whenever you copy your HTML page to somewhere new you must copy all of the resources it's linked to as well. Make sure the image is in the same folder as the HTML file and that it has the same file name as what you've written in the src attribute. Link to comment Share on other sites More sharing options...
davej Posted January 8, 2015 Share Posted January 8, 2015 You say you are... "developing locally on IIS 8" ...but what does that mean to you? You also say you have... "created an index.html file and stored it on my desktop" ...which doesn't make any sense if you are using IIS. What are you typing into the address bar of the browser? Are you absolutely certain the html file and the jpg file are in the same folder? Have you examined the file properties to verify the image filename? Hopefully you have disabled the folder option which hides known file extensions? Link to comment Share on other sites More sharing options...
st.chalz Posted January 8, 2015 Author Share Posted January 8, 2015 Godday "DAVEJ", okay let me clear myself on this, before i started developing on my PC. i did the following, 1; i created a folder on my desktop as (Newfolder web).. 2; i assembled some code on my NOTEPAD of which the first i saved and stored as (index.html) on my desktop(Newfolder web). 3; so anytime i want to view the index.html file as a web page, i would simply locate the (Newfolder web) and then click on the Home page. there and then i can now see it as a typical website page like Flexmall.com. but i couldnt see the Image element i inserted. Link to comment Share on other sites More sharing options...
dsonesuk Posted January 8, 2015 Share Posted January 8, 2015 Desktop? desktop as in the screen you see on opening your O/S as you can save folders and files to this, OR as general the whole desktop PC where you are creating web folders on the C: drive. When you install IIS it by default creates a c:inetpub folder within that there is a www folder where you place your web folders and access it by entering localhost/webfoldername/ (NOTE: no spaces in folder name) and if you have a file going by index.* or default.* with extension *.htm, *.html, *.asp, .aspx it should open this page. I'm going back here, but you use to be able to right click a folder and set that folder as web folder, with a alias name, and adjust permissions to read, write, and execute from that folder OR access IIS and set these there , I think now it is all done through IIS now, but you would only do this if you wanted to use a folder other than the c:inetpub that as said is created automatically on installation. Images image file names MUST match exactly as image01.jpg is treated as different picture if referenced in src of img tag as image01.JPG, same with IMAGE.jpg compared to image.jpg these will be treated as two different images Link to comment Share on other sites More sharing options...
davej Posted January 9, 2015 Share Posted January 9, 2015 "i would simply locate the (Newfolder web) and then click on the Home page." Then you aren't using IIS 8. RIght-click on your image file, select Properties, and read the file name. Link to comment Share on other sites More sharing options...
st.chalz Posted January 9, 2015 Author Share Posted January 9, 2015 ok, "DAVEJ" . this is the information i have on my image file. Name: photo0537_001 Type of File: jpg file (.jpg) Opens with: photos Location : C:/Users/charles/Pictures Size : 53.0kb from the above information have been using the "Name" as my (src) then" Type of File " as my (alt ) but yet no visible picture.all i c is a broken link till this point in time. Link to comment Share on other sites More sharing options...
Ingolme Posted January 9, 2015 Share Posted January 9, 2015 Put the HTML file and the image file in the exact same folder right next to each other. Make sure that you know what the extension of the image is. ".jpg" is different than ".JPG", you must use the one that the image file has. Windows often has file extensions hidden by default, you can change that in the folder options. Link to comment Share on other sites More sharing options...
davej Posted January 9, 2015 Share Posted January 9, 2015 Location : C:/Users/charles/Pictures Why doesn't it say C:/Users/charles/Desktop/Newfolder_web ??? Link to comment Share on other sites More sharing options...
st.chalz Posted January 10, 2015 Author Share Posted January 10, 2015 Goodday, "INGOLME" i actually did what u said by checking the extension file as to be sure and also the inclusion of the image file in html folder but yet no positve result yet.. Link to comment Share on other sites More sharing options...
st.chalz Posted January 10, 2015 Author Share Posted January 10, 2015 Goodday, "DAVEJ" it was when i brought the image file to the newfolderweb that was when it included the newfolderweb extension to the location directory of the image file. Link to comment Share on other sites More sharing options...
dsonesuk Posted January 10, 2015 Share Posted January 10, 2015 Try this just to check image works in browser and get absolute path. 1) right click image in question and chose 'open with' 2 ) this should show a browser (firefox, explore etc) as option, if not select 'choose default program' 3) uncheck 'Always use the selected program to open this kind of file' and browse for internet browser. 4) once selected click 'ok' and this should open the image in selected browser. 6) replace src of img tag with this, it should show, if it does, you know it works, and change it to relative path. 7) if not! your html file is incorrect, or it is not saved correctly with correct Encoding (if you use Notepad ++ (google and download) it will save it correctly by default, you don't have to worry about saving with correct encoding like you do using windows notepad. Link to comment Share on other sites More sharing options...
johnniewalk Posted November 11, 2016 Share Posted November 11, 2016 Actually i think after writing a code for image file you have to upload it in a tools like dream viewer or something in that, according to your theme there is a path to upload your images in that path you have to upload your images.. Link to comment Share on other sites More sharing options...
davej Posted November 11, 2016 Share Posted November 11, 2016 Actually i think after writing a code for image file you have to upload it in a tools like dream viewer or something in that, according to your theme there is a path to upload your images in that path you have to upload your images.. No, he's taking about using local files on his own computer. If you create a folder on your desktop and you put the image file and the html file in that same folder then it should find the image. If you want to actually use IIS then you can't put the folder on your desktop. You will need to find and use your inetpub\wwwroot folder. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now