Moved code from form page and created UploadFile class, defined number of functions.