You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
569 B

<%@ Import Namespace="System.IO" %>
<%@ Page Language="c#" %>
<script language="C#" runat="server">
void Page_Load(object sender, EventArgs e) {
string bookId = Request.QueryString["bookId"].ToString();
FileStream srFile = new FileStream(HttpContext.Current.Server.MapPath("resources/pdf/book_" + bookId + ".pdf"), FileMode.Open, FileAccess.Read);
byte[] pdfData = new byte[srFile.Length - 1];
srFile.Read(pdfData, 0, (int)srFile.Length - 1);
srFile.Close();
Response.AddHeader("Last-Modified", DateTime.Now + " GMT");