fix get_file_url method 

It was removing extra chars also at the end of the string and thus generating a broken url.