internal javascript upload