Title
Is there a way to limit the size of an image in a container field? Can this be a button?
Post
Hello All,
I have searched google and the FM forums and can not find a straightforward answer to this, so I thought I would post my own question in hopes to find a clear answer.
In my database I have 4 container fields per material record. I'd like to make a limit on the size of the file (in this case image) that can go in the container field. I have heard that one way to do this is you can make a validated calculation with a "length limit" and I tried entering into the validation calulation:
Length (Image1) < 204800
I was told this was about 200kb and I am ok having it even be 500kb but when I tried to insert an image that was about 1.7Mb it did not object. What am I missing?
Also, I have read multiple times that having a button for "insert image" will prvent users from copying and pasting images which increase the size and disjoin the filepath. I'd like to make this button but when I tried it asked me for a specific path which I do not have, nor will I ever, since the user who uploads the image is the only one who would know it, but my users may not understand this and I'd like for them to just be able to choose the image from a "browse" screen like the one that shows up when you right click the conainter field and hit "insert image".
PLEASE help! Thanks!!
Hmmm, it worked for me.
Here's what I did:
I opened a DB test file with a container field.
I defined cLength as the calculation: Length ( ContainerField ) and placed it on my layout.
I used Insert Picture to insert an image without the "by reference" option selected
I copied the value of cLength to the clipboard. (2503647)
I then added this validation calculation to containerField:
Length ( self ) < 2500000
I then created a new record and inserted the same image with the same options.
When I committed the record by clicking the layout background, the validation error message popped up. If I has specified a custom validation message, this message could have told me that my image file was too large.