Server Error in '/blog' Application

Topics: ASP.NET 2.0
May 16, 2011 at 8:03 PM

Hello - I am receiving the following error when attempting to add a page. Error appears when I attempt to add an image to a new page. Any help is greatly appreciated!

Server Error in '/blog' Application.
Could not find a part of the path 'D:\inetpub\vhosts\sashprogram.com\httpdocs\blog\App_Data\files\2011\5\'.
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:\inetpub\vhosts\sashprogram.com\httpdocs\blog\App_Data\files\2011\5\'.

Source Error:

Line 302:            }
Line 303:
Line 304:            control.PostedFile.SaveAs(folder + fileName);
Line 305:        }
Line 306:


Source File: d:\inetpub\vhosts\sashprogram.com\httpdocs\blog\admin\Pages\EditPage.aspx.cs    Line: 304

Stack Trace:

[DirectoryNotFoundException: Could not find a part of the path 'D:\inetpub\vhosts\sashprogram.com\httpdocs\blog\App_Data\files\2011\5\'.]
   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, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +61
   System.IO.FileStream..ctor(String path, FileMode mode) +55
   System.Web.HttpPostedFile.SaveAs(String filename) +99
   Admin.Pages.EditPage.Upload(String virtualFolder, FileUpload control, String fileName) in d:\inetpub\vhosts\sashprogram.com\httpdocs\blog\admin\Pages\EditPage.aspx.cs:304
   Admin.Pages.EditPage.BtnUploadImageClick(Object sender, EventArgs e) in d:\inetpub\vhosts\sashprogram.com\httpdocs\blog\admin\Pages\EditPage.aspx.cs:386
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.4211; ASP.NET Version:2.0.50727.4209