Validating 'Insert Picture' by File Type
I keep coming back to this issue, deciding it's not important enough to spend time on, then coming back again. I have several fields that are meant to be containers for PDF attachments and I've been using the 'Insert Picture' script to upload the files. This works simply and effectively, but I'd like to be able to limit the file type to PDF only, not any picture file. I think to do this I need to be able to read the filename on import, but I don't know if this is possible.
Reading the file name on import could also be useful such that I could set a variable or field with the actual file name so that when the file is exported I could re-tag it with the original file name.
Below is the validation script that I tried using. It should relay my idea of how I think it should work, although it obviously did not work or I wouldn't be here. Thanks!
( Right ( Get ( DocumentsPath ) ; 4 ) = ".pdf" ) or ( Right ( Get ( DocumentsPath ) ; 4 ) = ".Pdf" ) or ( Right ( Get ( DocumentsPath ) ; 4 ) = ".PDF" )