os pongo el codigo que tengo para leer y mostrar el fichero:
Código:
<%
fichero = Request.ServerVariables("APPL_PHYSICAL_PATH") & "\data\" & request("path")
file = request("path")
if instr(fichero, "..")>0 then response.end
intPos = instrrev(file, "/")
strFichero = right(file, Len(file) - intPos)
intPos = instrrev(strFichero, "\")
strFichero = right(strFichero, Len(strFichero) - intPos)
'Set the content type to the specific type that you are sending.
Response.ContentType = "application/octet-stream"
Response.Addheader "Content-Disposition", "inline; filename=" & strFichero
Const adTypeBinary = 1
'This is the path to the file on disk.
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile fichero
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
He visto que la linea:
Response.ContentType = "application/octet-stream" es para cuando no se sabe el tipo de fichero que se ha de mostrar (yo debo mostrar tanto pdf como doc ect.)...
Plz. que alguien me oriente pq no sé que puede ser...