separate out uploading for js