fix redirect after save a file + tiny changes

1 - fix redirect after save a new file
2 - added native recursive directory creator
3 - added default extension according to pagetype