Results 1 to 2 of 2

Thread: Picture is not shown in browser

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2016
    Posts
    255

    Picture is not shown in browser

    Hi,
    I am an aboslute starter in HTML.
    I have programmed a server to show text and picture in a browser using VB.net. If I call the server using local IP adress vom webbrowser in VB text and picture are shown. If I call from firefox only text an an empty box for the picture is shown. How can I fix this?

    within a thread I run the following program
    Code:
                Dim client As TcpClient = server.AcceptTcpClient()
                Dim stream As NetworkStream = client.GetStream() 
                Dim i As Int32 = stream.Read(bytes, 0, bytes.Length)
                data = Nothing
                data = System.Text.Encoding.ASCII.GetString(bytes, 0, i)
                Dim objReader As New StreamReader("D:\Hallo World.htm")
                data = objReader.ReadToEnd
                objReader.Close()
                Dim msg As Byte() = System.Text.Encoding.ASCII.GetBytes(data)
                stream.Write(msg, 0, msg.Length)
    the html file is:
    HTML Code:
    <html>
    <head>
    </head>
    <body lang="de">
    <p class=MsoNormal>Hallo Welt</p>
    <a href="http://192.168.178.89/" >
    <img src="D:/image001.jpg"
    width="474" height="474" 
    alt="html-seminar.de - jetzt HTML lernen">
    </a>
    </body>
    </html

  2. #2
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Picture is not shown in browser

    I would imagine it is the src path for the img element, the path D:/image001.jpg is referring to a local path so the browser is looking for the image on the D: drive, try using a relative path (just image001.jpg) and see if that helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width