Yep, I know length(container field) is supposed to give the size of the file in bytes. I loaded a .png file into the container field and the file size was calculated to be 2,369,955 byes. However, my Mac says the the file is only 338,903 bytes. Another .png file is calculated in FileMaker to be 837,012 bytes, but my Mac says the file is 114,572 bytes. And so it is with all the other files, which are mostly .png, .jpg, and .pdf.
I had set up a button using the "insert picture" script instead of the "insert file" function to populate my container field. I did this because all of my files are maps and I need to have a preview available for each record. The "insert file" script previews only the icon, while the "insert picture" script previews the actual document. I have another button to "export file" and it seems to export the original file, regardless of whether it was inserted using the "file" or "picture" method.
I just discovered, however, that if the file is inserted as a "picture" rather than as a "file" it gives me the hugely inflated byte count. When I insert the map as "file" it accurately calculates the byte count. Of course in that case I then don't get a preview of the actual file, just its icon.
This makes no sense to me. Why in the world can you have one or the other, but not both? Why does a "file" have no real preview, while a "picture" has no correct file size? Why does FileMaker even distinguish between a "file" and a "picture?" Why can't it accurately calculate a file size using two virtually identical methods of loading?
--
Helo