merging main view and file upload views , working code but needs cleaning up