Hi, im new in programming. i just got stuck in a very small thing (may be) well i am storing pdf on server path due to some security problems iframe does not read pdf from server path so please help me if u have any idea about it.
Here is my code
var filename = "";
var filesavepath = "";
HttpPostedFileBase file = null;
file = Request.Files[0];
var uploadfile = Request.Files[0];
if (file.ContentLength > 0)
{
filename = Guid.NewGuid().ToString() + "_" + Path.GetFileName(uploadfile.FileName);
filesavepath = Server.MapPath(@"~\Books\" + filename);
uploadfile.SaveAs(filesavepath);
}
and my book display code is here
<div id="box1">
@foreach (var row in db.Query(bookread))
{
<p>
<strong><a href="#">@row.Title</a></strong><br />
<strong>Author : @row.Author </strong><br/>
</p>
<div class="pdfifram">
<iframe src="@row.BookLink" style="width:645px; height:700px;"></iframe>
</div>
}
</div>