You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be good if we could set a custom filename rather than relying on the filename of the file being served. In my case, the file to be served has a filename of random characters but I'd like to serve the file with a "friendly" name.
The text was updated successfully, but these errors were encountered:
As it stands this can be done be implementing your own Resource, the bundled FileResource class does not enable you to do this but you could essentially copy/paste this and alter the getAdditionalHeaders() method to emit a different file name in the Content-Disposition header.
This library has been designed to be a "slim" framework and doesn't contain "extended" functionality like that, the possible variants of where data would be sourced (e.g. a database) and what meta-data might need to be included (e.g. Expires: headers) are too wide to reasonably include everything all in one without making a very messy and confusing API. Rather than shipping the kitchen sink, I prefer the approach of good IoC design and interfaces - extensible rather than configurable in other words :-)
It would be good if we could set a custom filename rather than relying on the filename of the file being served. In my case, the file to be served has a filename of random characters but I'd like to serve the file with a "friendly" name.
The text was updated successfully, but these errors were encountered: