managed to allow the user to save a file associated with a query!!!!!!!