Fixed upload JavaScript