I have a site that show pictures that it gets from the pictures folder in my web app.
My site is hosted on go daddy and works fine. I can go to the site view the picture pages and it all works just fine.
I have given all the permissions I possibly can on go daddy (it's a hosting plan) which is application write and web visible.
Quite honestly I have no clue where the error is coming from or anything.
I set up my globals.asax page to email me where there are unhandled exceptions.
I keep getting this error
1 Could not find a part of the path 'D:\Hosting\myaccountNum\html\pictures\'. 2 3 Stack Trace: 4 at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 5 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) 6 at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) 7 at ImageFetch.writeSingleImage(Int32 ImageID, Int32 size, Stream output) 8 at ImageFetch.ProcessRequest(HttpContext context) 9 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 10 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 11
![]() |
0 |
![]() |
what is the line of code that causes the error?
Bruce
DiscountASP.NET: Developer Ready ASP.NET Web Hosting
- Microsoft Gold Certified Partner
- Voted 2008, 2007, 2006 & 2005 Best ASP.NET Web Hosting by asp.netPRO Magazine
![]() |
0 |
![]() |
that's just it i don't think it is my code. The site works. I can go there and i look at the pictures and everything. I believe the error is transparent to the user not sure i have never had any problems viewing them neither has anyone else that has tested it. No user has complained about it.
Here are the full details of the error
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Hosting\myaccount\html\pictures\'.
Generated: Thu, 05 Mar 2009 15:33:36 GMT
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Hosting\myaccount\html\pictures\'.
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, FileAccess access)
at ImageFetch.writeSingleImage(Int32 ImageID, Int32 size, Stream output)
at ImageFetch.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Server Variables
Name | Value |
---|---|
ALL_HTTP | HTTP_CACHE_CONTROL:max-stale=0 HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:text/html, */* HTTP_ACCEPT_ENCODING:gzip, deflate, identity HTTP_HOST:www.mysite.com HTTP_USER_AGENT:Mozilla/4.0 (compatible;) HTTP_X_BLUECOAT_VIA:6DAB13B1062C62CF |
ALL_RAW | Cache-Control: max-stale=0 Connection: Keep-Alive Accept: text/html, */* Accept-Encoding: gzip, deflate, identity Host: www.mysite.com User-Agent: Mozilla/4.0 (compatible;) X-BlueCoat-Via: 6DAB13B1062C62CF |
APPL_MD_PATH | /LM/W3SVC/3766874/ROOT |
APPL_PHYSICAL_PATH | D:\Hosting\myaccount\html\ |
AUTH_TYPE | |
AUTH_USER | |
AUTH_PASSWORD | |
LOGON_USER | |
REMOTE_USER | |
CERT_COOKIE | |
CERT_FLAGS | |
CERT_ISSUER | |
CERT_KEYSIZE | |
CERT_SECRETKEYSIZE | |
CERT_SERIALNUMBER | |
CERT_SERVER_ISSUER | |
CERT_SERVER_SUBJECT | |
CERT_SUBJECT | |
CONTENT_LENGTH | 0 |
CONTENT_TYPE | |
GATEWAY_INTERFACE | CGI/1.1 |
HTTPS | off |
HTTPS_KEYSIZE | |
HTTPS_SECRETKEYSIZE | |
HTTPS_SERVER_ISSUER | |
HTTPS_SERVER_SUBJECT | |
INSTANCE_ID | 3766874 |
INSTANCE_META_PATH | /LM/W3SVC/3766874 |
LOCAL_ADDR | xxx |
PATH_INFO | /UserControls/imagefetch.ashx |
PATH_TRANSLATED | D:\Hosting\myaccount\html\UserControls\ImageFetch.ashx |
QUERY_STRING | size=1&imageid=134 |
REMOTE_ADDR | xxx |
REMOTE_HOST | xxx |
REMOTE_PORT | 39620 |
REQUEST_METHOD | GET |
SCRIPT_NAME | /UserControls/imagefetch.ashx |
SERVER_NAME | www.mysite.com |
SERVER_PORT | 80 |
SERVER_PORT_SECURE | 0 |
SERVER_PROTOCOL | HTTP/1.1 |
SERVER_SOFTWARE | Microsoft-IIS/7.0 |
URL | /UserControls/imagefetch.ashx |
HTTP_CACHE_CONTROL | max-stale=0 |
HTTP_CONNECTION | Keep-Alive |
HTTP_ACCEPT | text/html, */* |
HTTP_ACCEPT_ENCODING | gzip, deflate, identity |
HTTP_HOST | www.mysite.com |
HTTP_USER_AGENT | Mozilla/4.0 (compatible;) |
HTTP_X_BLUECOAT_VIA | 6DAB13B1062C62CF |
![]() |
0 |
![]() |
sorry.. i am not seeing anything obvious i can tell.
Bruce
DiscountASP.NET: Developer Ready ASP.NET Web Hosting
- Microsoft Gold Certified Partner
- Voted 2008, 2007, 2006 & 2005 Best ASP.NET Web Hosting by asp.netPRO Magazine
![]() |
0 |
![]() |
Hi,
The problem is because somewhere in your code you have used the path
'D:\Hosting\myaccount\html\pictures\'.
which does not exist on the server i.e machine hosting the application.
You need to change this absolute path and put Server.Mappath() method to get the path on the server.
Hope it helps.
SUBHRANIL BASU RAY
Mumbai
TODAY'S TECHNIQUES ARE OBSOLETE FOR TOMORROW'S JOB.
PLS MARK MY REPLY "AS ANSWER" IF IT HELPED YOU.
![]() |
0 |
![]() |
nope that's not it i already have Server.MapPath("~\Pictures\" & albumid & "\"))
Like i said the site works, otherwise I would not be able to see the photos.
I only get the errors on occasion.
![]() |
0 |
![]() |
Hi,
Donot use Server.Mapth path add Image URl
User
http:// <your server name>/Images/1.jpg
or
<img src=".. or ~/Images/1.jpg/>Hope It helps
Thanks
Avinash Tiwari
Remember to click “Mark as Answer” on the post, if it helps you.
![]() |
0 |
![]() |
When you run on your local server, Did you encounter same error message?
______________________________________
Cheap Affordable Web Hosting | Windows Linux PHP ASPX MYSQL Website Hosting | Best Web Design Company
![]() |
0 |
![]() |