0

Should the file name in Content-Disposition be URL encoded?

Content-Disposition: attachment; filename=my file with spaces.png

or

Content-Disposition: attachment; filename=my%20file%20with%20spaces.png

I've tried with mixed results.

I have a library I'm using and it gets URL-encoding-happy. I don't know if it's correct in doing that.

Paul Draper
  • 78,542
  • 46
  • 206
  • 285
  • Possible duplicate of [How to encode the filename parameter of Content-Disposition header in HTTP?](http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http) – georgexsh Mar 28 '16 at 13:53

1 Answers1

0

No. URL-encoding is a hack for obsolete browsers that do not support the standard way of doing things, defined in http://greenbytes.de/tech/webdav/rfc6266.html

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98