Fixed upload in both javascript and Haskell