www.webdeveloper.com
Results 1 to 4 of 4

Thread: ASP Image

  1. #1
    Join Date
    May 2005
    Posts
    11

    ASP Image

    Hi ! need to do this (php) in asp :

    header ("Content-type: image/jpeg");
    $f = fopen("http://localhost/asp/rossend.jpg", "r");
    while(!feof($f)) {
    echo fgets($f);
    }

    File MUST be an URL.
    The file need to be openend by a <img> tag : <img src="image.asp">


    Tried :

    Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
    Http.Open "GET", "http://localhost/asp/rossend.jpg", False
    Http.Send
    Http.WaitForResponse
    Response.ContentType = "image/jpeg"
    Response.BinaryWrite(Http.ResponseStream)

    Tried workaround whith ADODB.Stream and Microsoft.xmlHTTP and failed too.

    Spent more than 2 days searching the web and not found.

    Thanks.
    Last edited by rbruch; 03-24-2006 at 07:55 AM.

  2. #2
    Join Date
    Feb 2006
    Posts
    34
    Explain what this script is doing and I might be able to help you.

  3. #3
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    Off the top of my head, and I haven't played with PHP at all, I'd say the goal is to grab an image off of one server and place it on the local server.
    54 68 65 42 65 61 72 4D 61 79

  4. #4
    Join Date
    May 2005
    Posts
    11
    Ok I solved the problem myself. I'll explain to share it.

    I'll needed to display an image from a webcam in a html file. The server of the webcam is login/password protected, so i need an asp file which grab the image and serve it to the html file. Here we go !

    File 1 [image.asp]
    <%@LANGUAGE="VBSCRIPT"%>
    <%
    Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
    Http.Open "GET", "http://000.000.000.000/Jpeg/CamImg.jpg", False
    Http.SetCredentials "guest", "guest", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
    Http.Send
    Http.WaitForResponse
    Response.ContentType = "image/jpeg"
    Response.BinaryWrite(Http.ResponseBody)
    %>

    File 2 [display.html]
    <body>
    <img src="image.asp">
    </body>

    Hope it to be usefull.

    Bye !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles