added upload functionality with js validation