As we could see in many web site. while we tried to download the file, we would not be able to see the original URL, but just the file name. I tried to some thing similar like this. I have got some sample code here.
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select file from downfile where downid="&request("id")&" and downno="&request("no"),conn,1,1
if not rs.eof then
fileurl = rs("file")
else
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write error
response.end
end if
rs.close
rs.open "select hits,hy from down where id="&request("id"),conn,1,2
if not rs.eof then
hy=rs("hy")
rs("hits")=rs("hits")+1
rs.update
else
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write error
response.end
end if
rs.close
response.redirect fileurl
As you have seen, the page will redirect to fileurl, which is the URL address contained in the database. I have visited the site which use this code and it works as I mentioned above, but dosen't work on my site. Is this a correct code or I should use some thing else? Thanks