Prabhat wrote on 03 dec 2005 in microsoft.public.inetserver.asp.general:
>>
>> Move the files to a folder above your webroot. If authenticated send
>> the file via email from the server.
>>
>> --
>> John Blessing
> Hi John,
>
> But it is not possible to send those files in email. Because the size
> is BIG. So only option will be to allow download but securely. If I
> will move to a folder above the root then How do I allow download?
>
if session("authorized")<>"yes" then response.end
name="xxxx.pdf"
strFilePath="c:\blah\"&name
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath
Response.Buffer = false
Response.ContentType = "application/pdf"
Response.AddHeader "Content-Type", "application/pdf"
'' or whatever your file is
Response.AddHeader "Content-Disposition","inline;filename="&name
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
>> Stay informed about: How to Restrict Unauthorized Downloads