I have an asp page that checks that a user is logged in, and have the permissions to view a requested file.
On the local network, the server transfers the data correctly and there are no problems. However, when I send the file over the internet it appears that the HTTP headers are being stripped. This results in the file not being able to be interpreted correctly by the browser. Does anyone know what could cause this?
Under Firefox, I see the data displayed as text (very interesting for XLS files); and under IE I receive a series of error messages:
[tt]
1. Could not open '2. Microsoft Excel cannot access the file '...'
3. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
[/tt]
Just incase anyone is confused as to what I am talking about, here is the signifigant code on the server:
[tt]
Response.Clear
set stm = server.CreateObject("ADODB.Stream")
stm.Mode = 3 'readwrite
stm.Type = 1 'binary
stm.Open
stm.LoadFromFile strCopyFile
with response
.AddHeader "cache-control","no-cache"
.AddHeader "content-type", mime
.AddHeader "content-length",stm.Size
.AddHeader "content-disposition","inline; filename=" & strFilename
.BinaryWrite stm.Read(stm.Size)
end with
stm.Close
set stm = nothing
Response.End
[/tt]
On the local network, the server transfers the data correctly and there are no problems. However, when I send the file over the internet it appears that the HTTP headers are being stripped. This results in the file not being able to be interpreted correctly by the browser. Does anyone know what could cause this?
Under Firefox, I see the data displayed as text (very interesting for XLS files); and under IE I receive a series of error messages:
[tt]
1. Could not open '2. Microsoft Excel cannot access the file '...'
3. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
[/tt]
Just incase anyone is confused as to what I am talking about, here is the signifigant code on the server:
[tt]
Response.Clear
set stm = server.CreateObject("ADODB.Stream")
stm.Mode = 3 'readwrite
stm.Type = 1 'binary
stm.Open
stm.LoadFromFile strCopyFile
with response
.AddHeader "cache-control","no-cache"
.AddHeader "content-type", mime
.AddHeader "content-length",stm.Size
.AddHeader "content-disposition","inline; filename=" & strFilename
.BinaryWrite stm.Read(stm.Size)
end with
stm.Close
set stm = nothing
Response.End
[/tt]