I'm going to have to re-create this in a test BSV to be sure.)
This process runs from a "Upload" button in a Panel Operations area:
Code: Select all
CREATE Photos FOR EACH FileItem WITH
Photos.PhotoDoc=FileItem.Doc,
Photos.Photo=FileItem.Doc,
Photos.Photoroute=SystemSettings.ImagesRoute+Estimate.EstimateNum+'\'+FILE_NAME(FileItem.Doc)+'.'+FILE_EXTENSION(FileItem.Doc)
FileItem.Doc -> sets Photo_DOCTYPE in the db to have a .jpeg extension (incorrect, uploaded photo is .jpg)
FILE_EXTENSION(FileItem.Doc) --> returns .jpg
FILE_EXTENSION(Photos.Photo) --> returns .jpeg
I noticed this when I saved an image to local drive. I wondered why the extension was "jpeg" and not "jpg".
In my expression that calculates Photoroute, I was using Photos.Photo inside the FILE_EXTENSION function. That gave me ".jpeg".
If by chance you use FileItem.Doc inside the function, you'd get the correct value.
I don't know why the difference. In another rule, where I didn't have FileItem object, I get a different extension. Got a mismash all over my database now.