Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Streaming an image

Status
Not open for further replies.

daint

Technical User
Oct 4, 2000
46
GB
Hello,

I was looking to download an image on another server via my own webspace. This is because certain websites are blocked at my company, I can download text via a script on my own server, but having problems with images.

The following is in an asp file called say xxx.asp, when I use <img src="xxx.asp> the image is display, but I would like to be able to called an external image.

<%with response
.Expires=0
.Expires=-1
.ExpiresAbsolute = #1/1/1980#
.AddHeader "Pragma", "no-cache"
.ContentType = "image/jpeg"
end with

Dim oStream
set oStream = server.createobject("ADODB.Stream")
oStream.Type = 1
oStream.Open
oStream.LoadFromFile Server.MapPath("..\htdocs\Add001.JPG")
'" False

response.binarywrite oStream.read
set oStream=nothing
response.End
%>


When I get rid of Server.MapPath and use a url, it simply returns a 500 error message.

Anyone have any ideas

Thanks

Daint
 
Thanks for the reply, but has anyone got any ideas of how this can be done, if not via the ADODB.Stream method.

I don't have many privilages on the server, just the basics that are given on fasthosts.co.uk

Any help would be greatly appreciated

Thanks

Daint
 
Perhaps you could use the server-safe version of xmlhttp to pull the file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top