You need to create a page that processes the download. The path to the file
can be anywhere but you just give the querystring param just the file name
(or ID number) then do something like this (I think)
------------------------
<%
filename = server.mappath("") ' Fill in the filename e.g. test.pdf,
Response.Buffer = True
dim objFSO, objTS
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(fileName)
sFileType= Right(fileName,4)
NameFile=Right(FileName,Len(FileName)-InstrRev(FileName,"\"))
Select Case strFileType
Case ".asf"
ContentType = "video/x-ms-asf"
Case ".avi"
ContentType = "video/avi"
Case ".doc"
ContentType = "application/msword"
Case ".zip"
ContentType = "application/zip"
Case ".xls"
ContentType = "application/vnd.ms-excel"
Case ".gif"
ContentType = "image/gif"
Case ".jpg", "jpeg"
ContentType = "image/jpeg"
Case ".wav"
ContentType = "audio/wav"
Case ".mp3"
ContentType = "audio/mpeg3"
Case ".mpg", "mpeg"
ContentType = "video/mpeg"
Case ".rtf"
ContentType = "application/rtf"
Case ".htm", "html"
ContentType = "text/html"
Case ".asp"
ContentType = "text/asp"
Case Else
'Handle All Other Files
ContentType = "application/octet-stream"
End Select
response.contenttype=ContentType
response.AddHeader "content-disposition", "inline; filename=" & NameFile
Do While Not objTS.AtEndOfStream
strChunk = objTS.Read(32)
strTmp = ""
For i = 1 to Len(strChunk)
strTmp = strTmp & ChrB(Asc(Mid(strChunk, i, 1)))
Next
Response.BinaryWrite strTmp
Response.Flush
Loop
objTS.Close
Set objTS = Nothing
Set objFSO = Nothing
%>
------------------
Found this by searching the web, by looking at it it _might_ be similar to
what you are after.
In the code you can state the dir where all your files live...but don't
state it in the QS.
Good luck
Stu
"JJ" <nospam> wrote in message
news:41***********************@news.dial.pipex.com ...
Hi,
I am writing a cart in ASP selling downloadable files.
The files are stored on remote locations i.e.
http://www.thisfilestore.com/file1.zip
And have different extensions, i.e. they are not all zip files.
I would like to write a script which cann be called which will allow the
download of the file, without giving away the url.
Any Ideas/examples welcome!
Thanks in Advance
JJ