Add error handling.
Use the params of from and dir.
Use buttons instead of links.