Fix type, add extesion to file, add validate mimeType

Fix type: Fixed name code in comments
add extesion to file: add extension to files generated by proxy, to prevent blocking of unknown files on some servers (eg: IIS)(eg: IIS)