105
rated 0 times
[
107]
[
2]
/ answers: 1 / hits: 25508
/ 10 Years ago, mon, april 14, 2014, 12:00:00
Content-disposition header contains filename which can be easily extracted, but sometimes it contains double quotes, sometimes no quotes and there are probably some other variants too. Can someone write a regex which works in all the cases.
Content-Disposition: attachment; filename=content.txt
Here are some of the possible target strings:
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 some other combinations might also be there
More From » regex