Image Upload, can't upload images

Topics: ASP.NET 2.0, Controls
Apr 20, 2008 at 9:47 PM
Edited Apr 20, 2008 at 10:59 PM
Hi everyone. I would like some assistance with image upload. I have the blog installed here: http://www.pickerelcreek.com/blog/ and you can log in with the default admin : admin.

I CAN create new posts, but I CANNOT upload images. Anyone, please give me a hand with this. I have just started playing with the blog, and this is doing my head in.
It is setup standard install, NOT SQL.
Here is the error message from Win2k3 server event log....

-----------------
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 4/20/2008 5:52:44 PM
Event time (UTC): 4/20/2008 9:52:44 PM
Event ID: 13534b6e99e04f7ab9391b0f9b1fe62c
Event sequence: 9
Event occurrence: 2
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/556609079/Root/blog-3-128532018440468750
Trust level: High
Application Virtual Path: /blog
Application Path: C:\Webs\pickerelcreek.com\www\blog\
Machine name: PICSTOR

Process information:
Process ID: 4004
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: DirectoryNotFoundException
Exception message: Could not find a part of the path 'C:\Webs\pickerelcreek.com\www\blog\App_Data\files\smimg.gif'.

Request information:
Request URL: http://www.pickerelcreek.com/blog/admin/Pages/Add_entry.aspx
Request path: /blog/admin/Pages/Add_entry.aspx
User host address: 71.100.231.120
User: admin
Is authenticated: True
Authentication Type: Forms
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode)
at System.Web.HttpPostedFile.SaveAs(String filename)
at adminentry.Upload(String virtualFolder, FileUpload control) in c:\Webs\pickerelcreek.com\www\blog\admin\Pages\Addentry.aspx.cs:line 97
at adminentry.btnUploadImageClick(Object sender, EventArgs e) in c:\Webs\pickerelcreek.com\www\blog\admin\Pages\Add_entry.aspx.cs:line 79
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
-----------------

Thanks!
Tim
Apr 21, 2008 at 5:03 PM
Hi Everyone!
I am still having an issue with this, and I am stumped. I really like the blod and would like to use it to its potential, but the issues remain.
Please, any help would be greatly appreciated.
Tim
Apr 21, 2008 at 7:47 PM
A few things come to mind.

~/App_Data/ needs to have proper permissions
~/App_Data/files needs to exist
~/App_Data/files needs to have the proper permissions

The permissions it needs are :
NETWORK_SERVICE (or similar) needs read, write and modify permissions
IUSR_<machine name> (or ASP.NET USER) needs read, write and modify permissions

You should also setup the permissions to allow it to inherit so that way the new files get setup with the proper permissions too. If you are on shared hosting you should have a tool to do this, if you are hosting it yourself then use the "Security and Permissions" tab.
Apr 21, 2008 at 9:03 PM
jwendl,
AWESOME!
There was no "~/App_Data/files " folder... That was the issue!
:)
On a side note, I did the standard install, and the folder was not in my files to upload.