-1

I made a small console application using c# that get all categories and loop into them if finds picture Id =0 as I inserted before in Database call this function

 protected virtual byte[] LoadPictureFromFile(string filePath)
        {          
            if (!File.Exists(filePath))
                return new byte[0];
            return File.ReadAllBytes(filePath);
        }

which filepath is "C:\nopCommerce_3.70_Source\Presentation\Nop.Web\Content\Images\Thumbs\images"

and Then Insert it in Picture table in Database after that update category table row with the new Picture Id

till now there is no problem

but the probelm appears when I run the nopCommerce Solution on chrome explorer and try to show the image category

1- it copy the inserted images in "C:\nopCommerce_3.70_Source\Presentation\Nop.Web\Content\Images\Thumbs" folder with concatenation of 0000103_450_mypic

2- appears it broken in browser and the folder "C:\nopCommerce_3.70_Source\Presentation\Nop.Web\Content\Images\Thumbs"

please help

sara adly
  • 297
  • 1
  • 5
  • 19

1 Answers1

0

OK..my best guess is that you forgot to set IsNew Flag to true in Picture table. If it is not set, NopCommerce wont re-generate that image and you will end up with broken image.

Jeyara
  • 2,198
  • 1
  • 23
  • 26