A READER ASKS: Extracting Embedded File Data

From Dwayne Wright - Certified FileMaker 9 Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright

A READER ASKS
I'm finding your blogs very useful - thanks for putting them out there! I was wondering if you could answer a question for me: How can I restrict the type and size of a file uploaded via a container field?

I'm creating a print job request form for our copy shop, and we'd like to have users only be able to upload documents of certain types - PDF, Publisher .pub, InDesign, Word docs, etc.

Any help or advice you could provide would be greatly appreciated.

-------
DWAYNE RESPONDS
Well, the only feedback I have is a bit fuzzy ...

The Length function on a container field will return the container objects size. So you can build a routine that brings the image in, deletes it if it is too large and then tells the user what happened.

You can also gain information about a file that is stored as a reference by using the GetAsText(Containerfield). When you wrap a container field with GetAsText and that container field stores the reference to that file, FileMaker will tell you that path! Now you are saying that you are embedding file into the field and not storing a reference. I imagine you could build a routine to import the reference first, store the path, based upon the file name in the path information detect its type, remove the embedded file, use the path to import the embedded version and know what its type is.

Maybe ... haven’t tested something like that.

If anyone has any suggestions, please let me know and I’ll pass it along!

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

=====UNPAID ADVERTISEMENT FOR A SERVICE I RECOMMEND=======
I am a big fan of listening to daily shows on my iPod as downloaded from iTunes. These shows are called podcasts and a unique FileMaker specific one has come on to the scene I’d like to share with you. It is called FM Success Tips and it is a weekly 20 minutes dose of FileMaker that you can listen to in the car, at the gym, at the office or wherever! You can subscribe via iTunes or listen to it on the web at http://fmsuccesstips.libsyn.com/index.php?post_category=podcasts !