Extract a helper method that can be shared with features.textbooks.py (upload_file method).