nopCommerce
nopCommerce copied to clipboard
Uploading new image to FTP doesn't not update
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:
Product List in the admin (showing the new image):
Product page in the admin:
Source: https://www.nopcommerce.com/en/boards/topic/97475/4603-dropping-images-into-ftp-doesnt-update
@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.
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.
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
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 @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.
But, all of the images in the admin are still still using the 'old' image with the white background.
Thanks, Craig
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.