cleaned up code of file upload post a little bit