JS for upload page