Bug 17501: Move getCategories and httpheaders from Upload.pm