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
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