Server Error in '/' Application.

Could not find a part of the path 'D:\HostingSpaces\wairoastar\www.wairoastar.co.nz\wwwroot\App_Data\Newspaper\20200714\wspage010.pdf'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\HostingSpaces\wairoastar\www.wairoastar.co.nz\wwwroot\App_Data\Newspaper\20200714\wspage010.pdf'.

Source Error:


Line 29: 
Line 30:             Dim fileName As String = Server.MapPath("~/App_Data/" & Request.QueryString("p") & "/" & Request.QueryString("f") & ".pdf")
Line 31:             Dim data() As Byte = IO.File.ReadAllBytes(fileName)
Line 32: 
Line 33:             If (Request.QueryString("d") = 1) Then

Source File: D:\HostingSpaces\wairoastar\www.wairoastar.co.nz\wwwroot\Handlers\PdfHandler.aspx.vb    Line: 31

Stack Trace:


[DirectoryNotFoundException: Could not find a part of the path 'D:\HostingSpaces\wairoastar\www.wairoastar.co.nz\wwwroot\App_Data\Newspaper\20200714\wspage010.pdf'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +193
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +66
   System.IO.File.ReadAllBytes(String path) +58
   Handlers_PdfHandler.Page_Load(Object sender, EventArgs e) in D:\HostingSpaces\wairoastar\www.wairoastar.co.nz\wwwroot\Handlers\PdfHandler.aspx.vb:31
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8806; ASP.NET Version:2.0.50727.8762