fix a bug of calling getFilename on url link attachment.
adapt code to integrate with the existing wildcards system.