nopCommerce icon indicating copy to clipboard operation
nopCommerce copied to clipboard

Uploading new image to FTP doesn't not update

Open untiedshoes opened this issue 1 year ago • 5 comments

nopCommerce version: 4.60.3

Steps to reproduce the problem: With 4.40.4, and using Azure Blob Storage, we could update product images by uploading a new image (same file name, so just overwriting) to www/images/ folder. This would then create the new thumbs, and push them to azure.

With 4.60.3, this isn't happening. If we upload a new product with new images via the admin, it's all good an works as you'd expect.

Even 'turning off' azure blob storage, so just using local storage for images, the product image doesn't get updated if we ftp a new image with the same file name.

Any ideas?

*update: The thumbnail shown in the admin products list gets updated, but the main product image doesn't.

Front end: Screen Shot 2023-06-28 at 14 39 20

Product List in the admin (showing the new image): Screen Shot 2023-06-28 at 14 39 27

Product page in the admin: Screen Shot 2023-06-28 at 14 40 47

Source: https://www.nopcommerce.com/en/boards/topic/97475/4603-dropping-images-into-ftp-doesnt-update

untiedshoes avatar Jun 28 '23 13:06 untiedshoes

@untiedshoes Since version 4.40, there were no significant changes in PictureService, only support for SVG was added.

Anyway, there is no need for this issue now, as uploading images in the admin area works as expected. Post your question on our forums, perhaps the community can help. And if it turns out that the problem is in project code, we'll reopen this issue.

RomanovM avatar Jun 28 '23 14:06 RomanovM

We have multiple stores (multi-stores), with thousands of products, and have always updated the product images this way, but since moving to 4.60.3 it doesn't work.

untiedshoes avatar Jun 28 '23 14:06 untiedshoes

There's definitely a bug somewhere, but can't find it.

Making a change to the Product thumbnail image size (catalog) makes that image change to uploaded one, but making a change to Product detail image size keeps the original file.

untiedshoes avatar Jun 28 '23 16:06 untiedshoes

@untiedshoes In the PictureService of 4.40 method of UpdatePictureAsync the lines 970-972 //delete old thumbs if a picture has been changed if (seoFilename != picture.SeoFilename) await DeletePictureThumbsAsync(picture); Were changed in lines 993-994 //delete old thumbs if exists await DeletePictureThumbsAsync(picture); Not sure if this may be your issue, I guess you can always try adding the comparison if back in and see if it is the issue. I use the admin as I do not deal with the numbers of images your referring to.

glhays avatar Jun 28 '23 22:06 glhays

@glhays @RomanovM Thanks man, but as I thought, that didn't change anything.

Anyway, we've come back this morning, and 'some' of the images have changed overnight!?

Looking at the image below, the thumbs are all using the 'old' image, whereas the large image is using the 'new' image with a grey background. The new image was just dropped into the images folder 3 days ago, and has taken to this morning to change.

Screen Shot 2023-06-29 at 10 30 57

But, all of the images in the admin are still still using the 'old' image with the white background. Screen Shot 2023-06-29 at 10 35 43

Thanks, Craig

untiedshoes avatar Jun 29 '23 09:06 untiedshoes

Even 'turning off' azure blob storage, so just using local storage for images, the product image doesn't get updated if we ftp a new image with the same file name.

This is by design. In order for images to be replaced, you need to update them through the admin panel, but if other methods are used for replacement, such as ftp, then the system is not responsible for this and you need to let it know that the images have changed. This can be done by updating a table in the database (SQL query), as suggested on the forum.

DmitriyKulagin avatar Apr 17 '24 12:04 DmitriyKulagin