Detect file type

Update function get_fileurl