What would be the best way to check if a image is different from the one in SmartStore before uploading a ProductImage?
WebApi Upload Picture check first for difference
#1
Posted 30 April 2020 - 16:56
#2
Posted 30 April 2020 - 17:44
This cannot be detected via the API. So this is only possible on the client\consumer side.
Marcus Gesing
Smartstore AG
#3
Posted 01 May 2020 - 08:10
I was affraid you would say that. Because now we upload every x time all the product images. It would be great to have a mechanisme to check upfront if the picture is differtent. Like a field that contains the original file date or the hash of a file.
However in the documentation you mention the values "CustomValue1" and "CustomValue2" where are these values stored?
#4
Posted 01 May 2020 - 11:22
These are custom values for your own purpose, e.g. for an easier mapping. The API does not process them and just returns them in the ContentDisposition field of the response.
Marcus Gesing
Smartstore AG
#5
Posted 01 May 2020 - 12:38
Alright, so as you told before there is currently no way to check if a picture is different before uploading?
If not could you please add it to the API roadmap to include two fields, one is PictureCreation date which is the original creation date and the other is PicatureHas which is a MD5 or Sha1 hash of the file. In my opniniun this is the right way to check if a picture is different. If you have any other suggestions please let me know.
#6
Posted 01 May 2020 - 13:40
Marcus Gesing
Smartstore AG
#7
Posted 01 May 2020 - 13:44
The MediaFile.CreatedOnUtc would sound like a suitable property however which value is stored in, the original creation date of the file itself OR the moment the file is uploaded?
#8
Posted 04 May 2020 - 10:03
The time in UTC when the MediaFile entity was created and stored. A MediaFile does not necessarily represent a file on disk.
Marcus Gesing
Smartstore AG
#9
Posted 04 May 2020 - 15:19
Thanks for clearifyng that. I now created my own little database that stores the upload information so i can compare it before uploaded.