Question on images

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 年 前
I set the configuration to save images in file system rather than database.

I see that categories, products, brands, etc, all have a picture id. Looking at that table, you store the image in the database.

How do you point the entity at a file system location?
7 年 前
Maybe I wasn't clear with what I am asking, I would have assumed that since I choose file system instead of database, that either the pictures table would have a file directory and name field, or the entity itself, such as products, would have a image file directory and name field, but there is only pictureid and a filed to store the bytes.

What do I need to do to point at an actual file system location?
7 年 前
The file name is the Id from the Picture table. Have a look in \Content\Images and you should see images with names like 0000001_0.jpg, 0000002_0.jpg, etc. The bit before the underscore corresponds to the PictureId.
7 年 前
So when I ad them to the file system, can I skip saving them to the database as a byte? I just give them a naming convention and it figures it out?
7 年 前
RickDoll wrote:
So when I ad them to the file system, can I skip saving them to the database as a byte? I just give them a naming convention and it figures it out?

Depends what you mean by "add them to the file system". You still need a record in the Picture table with an Id that corresponds to the image file name but the PictureBinary column is nullable because when nop is set to save images to the file system it's left as null (so yeah you can skip that bit).

Normally nop would use the AsyncUpload method on the PictureController which would call the InsertPicture method on the PictureService.
7 年 前
I will be writing a script to mass import from our database, won't be adding through the nop back end.

So sounds like if I give the product I import the picture id and make sure the picture name corresponds with a picture id that should be good to go.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.