Unexpected Error when upload pictures

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 15 ans
First of all I want to thank everyone at NopCommerce for your fantastic effort. As a start-up business I've found your platform a lifesaver in getting my business of the ground and I'm looking forward to contributing to your effort!

I have run into an unexpected error when uploading pictures to my hosted webserver when adding a new category. I haven't experienced this with my build on my own computer.

Following is the error I receive:
[quote]
Server Error in '/' Application.
Access to the path 'C:\Inetpub\vhosts\ishopshop.co.za\httpdocs\images\thumbs\0000082_100_80.jpeg' is denied.

Source Error:

Line 54:                 Picture categoryPicture = category.Picture;
Line 55:                 btnRemoveCategoryImage.Visible = categoryPicture != null;
Line 56:                 string pictureUrl = PictureManager.GetPictureUrl(categoryPicture, 100, 80);
Line 57:                 this.iCategoryPicture.ImageUrl = pictureUrl;
Line 58:


Source File: c:\inetpub\vhosts\ishopshop.co.za\httpdocs\Administration\CategoryDetails.aspx.cs    Line: 56[/quote]

What I don't understand is why the system tries to access my personal computer instead of the webserver?
Il y a 15 ans
Hi Trevor,

Looks to me like this is referring to the file system on your web server, not your personal computer.

Need to have read/write permissions on the thumbs directory.

Hope this helps,
Ben
Il y a 15 ans
Hi Ben,

Thank you for your quick reply!

I was reading the error incorrectly, was wondering how on earth it could be pointing back to my system!

I think i've identified the problem. My website is hosted off site with an ISP and it seems they host it within an IIS directory which is subdivided to various virtual hosts, such as my domain.

I checked all my permissions and everything is in place but now i'm thinking that when the application uploads pictures it uses a temp directory which falls outside my permission. I think this is causing the problem.

Maybe I should somehow change the temp directory?

Here is the error message I just got: (I apologize for the lenght)

[quote]Log type:     Unknown
Severity:   11
Message:   Exception of type 'System.Web.HttpUnhandledException' was thrown.
Exception:   System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at System.Drawing.Image.Save(String filename, ImageFormat format) at NopSolutions.NopCommerce.Common.Media.PictureManager.GetPictureUrl(Picture picture, Int32 Width, Int32 Height, Boolean showDefaultPicture) in C:\temp\rac\NopCommerce.com\Solution\Web\downloads\nopCommerce_1.10\NopCommerce\Nop.Common\Media\PictureManager.cs:line 195 at NopSolutions.NopCommerce.Common.Media.PictureManager.GetPictureUrl(Picture picture, Int32 Width, Int32 Height) in C:\temp\rac\NopCommerce.com\Solution\Web\downloads\nopCommerce_1.10\NopCommerce\Nop.Common\Media\PictureManager.cs:line 111 at NopSolutions.NopCommerce.Web.Administration.Administration_CategoryDetails.BindData() in c:\inetpub\vhosts\ishopshop.co.za\httpdocs\Administration\CategoryDetails.aspx.cs:line 56 at NopSolutions.NopCommerce.Web.Administration.Administration_CategoryDetails.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\ishopshop.co.za\httpdocs\Administration\CategoryDetails.aspx.cs:line 95 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.administration_categorydetails_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\f3183ba8\902fc362\App_Web_onszqm-o.22.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
IP address:   41.243.15.134
Customer:   [email protected]
Page URL:   http://www.ishopshop.co.za/Administration/CategoryDetails.aspx?CategoryID=23
Created on:   3/5/2009 4:55:57 PM[/quote]
Il y a 15 ans
My website running on Vista Home also got the similar problem.

I have installed the NopCommerce at both of my PCs. The website set up at Windows XP sp2 works fine.
The one installed at Vista Home Premium is broken when it tries to open the Product page.
It errors out at the function:
...
NopSolutions.NopCommerce.Common.Media.PictureManager.GetPictureUrl(Picture picture, Int32 Width, Int32 Height, Boolean showDefaultPicture)
...
Il y a 15 ans
I think my problem is originally caused by privilege issues i'm having with my hosting server which then causes a database error since the program is trying to retrive a picture which is mostlikely only marked as being available but in reality was never uploaded. Giving you this error:

[quote]NopSolutions.NopCommerce.Common.Media.PictureManager.GetPictureUrl(Picture picture, Int32 Width, Int32 Height, Boolean showDefaultPicture)[/quote]

I've opted to build a custom uploading and management system to administrate my database. It's maybe not a fix for the problem but will help me work around it.
Il y a 15 ans
Trevor,

Just to confirm:

"i'm thinking that when the application uploads pictures it uses a temp directory"

NopCommerce uploads direct to the database when uploading images for category. It does not go to a temporary directory.
Il y a 15 ans
Hi,
I am facing the same issue. The issue does not happen when i access pages cached by the browser (that's what i think.. i maybe wrong). Its even happening for the default page (log below).

Can some one tell me what could be going wrong? My hosting is similar to Trevors description. Trevor, can you describe to me how you managed to work around this problem?

Thanks,
Srb.

Log snippet:
Log type:  Unknown  
Severity:  11  
Message:  Exception of type 'System.Web.HttpUnhandledException' was thrown.  
Exception:  System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at System.Drawing.Image.Save(String filename, ImageFormat format) at NopSolutions.NopCommerce.Common.Media.PictureManager.GetPictureUrl(Picture picture, Int32 Width, Int32 Height, Boolean showDefaultPicture) at NopSolutions.NopCommerce.Web.Modules.HomePageProductsControl.dlRelatedProducts_ItemDataBound(Object sender, DataListItemEventArgs e) in f:\vhosts\reubengallery.com\httpdocs\Modules\HomePageProducts.ascx.cs:line 74 at System.Web.UI.WebControls.DataList.OnItemDataBound(DataListItemEventArgs e) at System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) at System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.BaseDataList.DataBind() at NopSolutions.NopCommerce.Web.Modules.HomePageProductsControl.BindData() in f:\vhosts\reubengallery.com\httpdocs\Modules\HomePageProducts.ascx.cs:line 52 at NopSolutions.NopCommerce.Web.Modules.HomePageProductsControl.Page_Load(Object sender, EventArgs e) in f:\vhosts\reubengallery.com\httpdocs\Modules\HomePageProducts.ascx.cs:line 42 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\847b0add\e1b34ff6\App_Web_u9b9nb_7.78.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  
IP address:  125.16.138.136  
Customer:  
Page URL:  http://reubengallery.com/Default.aspx  
Created on:  3/12/2009 6:30:09 AM
Il y a 15 ans
Images are cached to disk at runtime. You need to make sure ASP.net has write permissions to the images directory.
Il y a 15 ans
Retroviz,
Thanks! That solved my problem.
Srb.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.