I want to load a csv file describing a graph from jQuery and call an APIFunction to evaluate its global clustering coefficient.
I'm not sure on how to call the APIFunction from the html form. I'm getting the following error. The matrix is not evaluated.
Here's my APIFunction code:
CloudDeploy[
APIFunction[{"myfile" -> "CSV"},
N@GlobalClusteringCoefficient[
AdjacencyGraph[Abs[Sign[#myfile]]]] &], Permissions -> "Public"]
My HTML:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(":file").css("background-color", "gray");
});
</script>
</head>
<body>
<form action="https://www.wolframcloud.com/objects/9f99606b-f688-4737-8e2d-eecc03a810b7" method="get">
File: <input type="file" name="myfile">
<input type="submit" value="Submit">
</form>
</body>
</html>