I typically use TOpenDialog
with its Filter
property for narrowing down available files for the user. I would like to further filter these files down by their content.
For example, the open file dialog should display only files with a ".bin" filename extension and its first 4 magic bytes are 0x7F, 0x45, 0x4C, 0x46 (ELF executable).
The condition will not always necessarily be identifying certain executable formats, but other binary data as well.
Is there a standard way of doing this in Delphi/VCL or do I have to postpone the content inspection until after the user has selected the file?