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

Leave a Comment