Generalised file import a little so that it can accept both uploaded and local files, and compression