I would let the browser handle it for you:
if you were saving the filename on the db,
"SELECT concat('<a href=',filename,'>',filename,'</a>')
FROM sometable"
Will return a link instead of just the filename.
When the user clicks this link, the file will get downloaded automatically.
You can use the "headers" you show in your PHP code, or you could modify .htaccess so Apache does that part for you. too.