Upload a file

def action_upload(self, courseid, taskid, path, fileobj):
        """ Upload a file """
        # the path is given by the user. Let's normalize it
        path = path.strip()
        if not path.startswith("/"):
            path = "/" + path
        wanted_path = self.verify_path(courseid, taskid, path, True)
        if wanted_path is None:
            return self.show_tab_file(courseid, taskid, _("Invalid new path"))

        task_fs = self.task_factory.get_task_fs(courseid, taskid)
        try:
            task_fs.put(wanted_path, fileobj.file.read())
        except:
            return self.show_tab_file(courseid, taskid, _("An error occurred while writing the file"))
        return self.show_tab_file(courseid, taskid)