Scenario: (in PHP) I have a form submission with a UTF-8 encoded string ($name
) to support international characters. Upon submitting the form (
It is enough to encode the file name according to RFC 3986 by using rawurlencode()
So all you need to do is change the header() line to:
header("Content-Disposition: attachment; filename*=UTF-8''".rawurlencode($name));
To answer the questions directly: