The Content-disposition header often contains a filename that may have different formatting, such as with double quotes or no quotes. Is there a regex pattern that can successfully extract the filename in all these cases?
Content-Disposition: attachment; filename=content.txt
Here are some examples of possible variations:
attachment; filename=content.txt
attachment; filename*=UTF-8''filename.txt
attachment; filename="EURO rates"; filename*=utf-8''%e2%82%ac%20rates
attachment; filename="omáèka.jpg"
and other combinations could also exist