Added security to requests and request to server when a file is uploaded