filename:Finds messages with an attachment of a given name or file type.
filename: accepts either a file type (filename:pdf) or a full name (filename:homework.txt).
filename:pdfOpen in Gmail ↗Messages with a PDF attachment.
filename:homework.txtOpen in Gmail ↗Messages with this exact file.
has:attachment: you pick the type (PDF, spreadsheet...) or the exact name.Google documents no limits for this operator.