Refactored formfileupload.js