Package Upload JS references Upload.cgi through absolute instead of relative path
Change xhr.open("POST", "/upload.cgi", true);
to xhr.open("POST", "upload.cgi", true);
to make the script work with installations located e.g. in http://localhost/Masala