<% sql_select = "SELECT tabla_notas.pdf_file, tabla_notas.id_categoria FROM tabla_notas WHERE tabla_notas.id_nota ="&id_nota Set cn = Server.CreateObject("ADODB.Connection") cn.Open data_source Set rsPDFs = Server.CreateObject("ADODB.Recordset") rsPDFs.open sql_select, cn If Not rsPDFs.EOF Then id_categoria = rsPDFs.Fields("id_categoria") download_pdf_file = rsPDFs.Fields("pdf_file") Else Response.Redirect "http://www.cadal.org" Response.End() End If rsPDFs.Close Set rsPDFs = Nothing cn.Close Set cn = Nothing '=================================================== If id_categoria = 49 Then Response.ContentType = "application/octet-stream" Else Response.ContentType = "application/pdf/" End If If id_categoria = 2 Then FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\documentos\" & download_pdf_file Elseif id_categoria = 3 or id_categoria = 24 or id_categoria = 52 or id_categoria = 56 Then FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\informes\pdf\" & download_pdf_file 'Elseif id_categoria = 39 Then 'FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\english\pdf\" & download_pdf_file Elseif id_categoria = 49 Then FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\audios\" & download_pdf_file Elseif id_categoria = 4 OR id_categoria = 46 Then 'este baja libros de la secci�n en castellano como de la secci�n en ingles, ya que, en ingl�s no hay libros... FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\libros\pdf\" & download_pdf_file Elseif id_categoria = 40 Then FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\researchreports\pdf\" & download_pdf_file Elseif id_categoria = 39 Then FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\documents\" & download_pdf_file Elseif id_categoria = 90 Then FPath = "C:\Inetpub\vhosts\cadal.org\httpdocs\DLC\" & download_pdf_file Else Response.Redirect "http://www.cadal.org" Response.End() End If Response.AddHeader "Content-Disposition","attachment; filename=" & download_pdf_file '================= ESADISTICA Set cn = Server.CreateObject("ADODB.Connection") cn.Open data_source sql_total_leidos = "INSERT INTO pdf_leidos (id_nota) VALUES ("& id_nota &")" cn.Execute sql_total_leidos cn.Close Set cn = Nothing '================= 'Set adoStream = CreateObject("ADODB.Stream") 'adoStream.Open() 'adoStream.Type = 1 'adoStream.LoadFromFile(FPath) 'Response.BinaryWrite adoStream.Read() 'adoStream.Close 'Set adoStream = Nothing 'Response.End %>