Forum Moderators: open
<%@ Language="VBScript" %>
<% Option Explicit %>
<%
Function cssImageLocation
Dim location
Randomize
location = "images/test/" & INT((7)*RND()) & ".jpg"
location = "http://www.example.com/" & location
cssImageLocation = location
End Function
%>
And here is what I was thinking for pseudocode...
pick random image file name
Response.ContentType = "image/jpeg"
open the file as a binary file
print the contents of the file to the Response
close the file
Can anyone give me some help with the opening and printing of the binary file though? Thanks!
[edited by: Xoc at 12:21 am (utc) on April 16, 2005]
[edit reason] no urls [/edit]
Can anyone give me some help with the opening and printing of the binary file though? Thanks!
I went through this a few years back, and came to the conclusion that it couldn't be done. I forget the reasons, but I think it was because you can't write binary data to the ASP Response object.
The workaround in ASP is to point your HTML to a page that Response.redirects to the image you want.
I think it can be done is ASP.Net however.