download_doc permission renamed in download_file
fix if extension of a file is not lowercase
add extension of the document extesion as rel of the pasted html block