Better handling of file to url