New debug and extra handling of file upload