Sending an Image to the Web Browser (Banner Exchan

Results 1 to 4 of 4

Thread: Sending an Image to the Web Browser (Banner Exchan

  1. #1
    Dave Waldrum Guest

    Default Sending an Image to the Web Browser (Banner Exchan

    I&#039ve been searching everywhere, writing code, trying everything, and can&#039t seem to figure this out.<BR><BR>Everyday banner exchanges, have a piece of code that is put on the "Web Sites" page, which has an:<BR><BR>&#060;img src=""&#062;<BR><BR>The bannerexchange&#039s perl script grabs and image and sends it to the web browser, usually using:<BR><BR>PRINT "Location: IMG URL

    ";<BR><BR>What I&#039m trying to do, is accomplish the SAME thing in ASP, so far with no luck.<BR><BR>I&#039ve tried using:<BR><BR>Response.Write "Location: IMG URL

    "; &#060;-- and many combinations<BR><BR>I&#039ve tried reading in the gif file using FileSystemObject, then using BinaryWrite to write the contents of the gif file to the web browser, I&#039ve tried setting the ContentType to "image/GIF". <BR><BR>All of this has gotten me no where. <BR><BR>What I need is a way to use ASP, to place an IMAGE on ANOTHER WEB SITES page. Like a banner exchange, or an affiliate network.<BR><BR>Using ASP Components is probably out of the question since I&#039m using a hosting company to host my website. :&#124<BR><BR>Any help would be greatly appreciated.<BR><BR>Thanks in advance!

  2. #2
    Ian Stallings Guest

    Default RE: Sending an Image to the Web Browser (Banner Ex

    I don&#039t have any code off hand to do this but it is<BR>interesting to me. Could you post the code using the Filesystem object and Binarywrite? I think this might be the correct<BR>track.<BR><BR>Ian

  3. #3
    Dave Waldrum Guest

    Default RE: Sending an Image to the Web Browser (Banner Ex

    This is the code to get the image using FileSystemObject, and then write it to the webbrowser..<BR><BR><BR><BR>&#060;%<BR>Response.Co ntentType = "image/GIF"<BR><BR>Dim strDir, strFileName<BR><BR>strDir = Request.ServerVariables("APPL_PHYSICAL_PATH")<BR>s trFile = "taebo.gif"<BR><BR>strFileName = strDir & strFile<BR><BR>Const ForReading = 1<BR><BR>Dim objFSO, objTextStream<BR><BR>Set objFSO = Server.CreateObject("Scripting.FileSystemObject")< BR>Set objTextStream = objFSO.OpenTextFile(strFileName, ForReading)<BR><BR><BR>Response.BinaryWrite "" & objTextStream.ReadAll & ""<BR>objTextStream.Close<BR><BR>Set objTextStream = Nothing<BR>Set objFSO = Nothing <BR><BR>%&#062;<BR>

  4. #4
    Juanma Guest

    Default RE: Sending an Image to the Web Browser (Banner Ex

    IT DOESN&#039T WORK<BR><BR>This is a problem without solution, at least with ASP. You&#039ll need to use a real language as Perl or another.

Posting Permissions

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