add optional filepath parameter to save function

If filepath can be set, is easier to integrate in a project without additional directory permisions for web server.