Override json encoding in rest api

It should be enough to add the content disposition field. But specifically it’s Content-Disposition not Content-disposition I would also add some validation to your filename parameter thats being passed to file_get_contents to ensure it exists and it’s valid. Else you might be vulnerable to directory traversal attacks or remote URL requests

WordPress Media Manager – limit to specific mime type

This is not full solution, it’s only a direction for you to work with media uploader Firstly, you need to know how to implement Media Uploader in your plugin/theme. You can learn that from the file: wp-admin/js/custom-background.js which is used by WP for custom background page. If that’s too hard to understand, then read this … Read more

Password protect some uploaded files, so only logged-in users can view them

See my question and answer again, you linked it already in your question: simple solution for restricting access to (some) uploads/downloads The solution isn’t that hairy the only necessity – besides configuring the plugin correct – is to create a .htaccess, which you could do programmatically. For that you have to automate the creation of … Read more