Hi..
This is my first time posting here, so i hope u can assist me.

I have this code

<%
'=======================
'Define the names of your functions
'=======================
Dim Stream
Dim Contents
Dim FileName
Dim FileExt
'Const adTypeBinary = 1
'=======================
'Get the actual file name from the URL that is passed to the browser
'=======================
FileName = request.form("fname") 'Get the name from the URL
'=======================
'GIVE AN ERROR MESSAGE IF THE URL IS EMPTY
'=======================
if FileName = "" Then
response.write "Filename Not specified."
response.end
end if
'=======================
'prevent access to certain files
'=======================
FileExt = Mid(FileName, InStrRev(FileName, ".") + 1)
select case UCase(FileExt)
Case "ASP", "ASA", "ASPX", "ASAX", "MDB"
response.write "You cannot access these file types."
response.end
end select
'=======================
'Start the download process if all is good
'=======================
response.clear
response.contentType = "application/octet-stream"
response.addheader "content-disposition", "attachment; filename=" & FileName
set stream = server.CreateObject("ADODB.Stream")
stream.type = adTypeBinary
stream.open

'im stuck here
stream.LoadFromFile ("X:\img\") & FileName


while not stream.EOS
response.BinaryWrite Stream.Read(1024 * 64)
wend
stream.Close
Set stream = Nothing
response.Flush
response.End
%>

X is a drive mapped to that particular folder which resides on different server.

when i tried using windows explorer, "X:\img\blablabla.gif" output the right image.
however , its not working in here.


Kindly assist.
TQ

You cannot map to a drive on a different server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.